OK. This is embarassing. I'm stuck in the "lol NOOB" bit in between knowing what PowerCLI is, and being catered for by the Documentation.
I've opened PowerCLI, and run the connect-viserver command. Now the prompt has changed to a >> but nothing works. I can type in commands all day long and press enter, but I just get given another prompt and nothing happens. Only CTRL+C does anything, which just chucks me back to the main prompt and leaves me unconnected.
So, what now? I just want to do some really basic commands, and I understand the syntax for them, but I've no idea how to get past this >> prompt and the documentation assumes less ineptitude than I'm displaying.
The ">> "prompt means that you are halfway typing a commandline. So PowerShell is waiting for the rest of the command. With Ctrl-C you break it and go to the normal prompt. To connect to a vCenter Server or ESX server you have to give the next command (substitute vCenter with the name of your server):
Connect-VIserver vCenter -Credential (Get-Credential)
Regards,Robert
That fails slightly less. I get a login box, but whatever I put into it (correct or otherwise) i get this::
Connect-VIServer : The type initializer for 'VMware.VimAutomation.Logging.SoapInterceptor.LoggingHelper' threw an excep
tion.
At line:1 char:17
+ connect-viserver <<<< -Server vcenter4.hesa.ac.uk -Credential (Get-Credential)
+ CategoryInfo : NotSpecified: ( , TypeInitializationException
+ FullyQualifiedErrorId : System.TypeInitializationException,VMware.VimAutomation.Commands.ConnectVIServer
Any ideas?
Does any of the accounts you entered have sufficient rights on the vCenter ?
You can also try leaving out the domainname when your vCenter is member of the same domain as the account you enter.
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Are you using the latest version of PowerCLI? The Get-PowerCLIVersion cmdlet should return:
[vSphere PowerCLI] C:\users\robert> Get-PowerCLIVersion PowerCLI Version ---------------- VMware vSphere PowerCLI 4.0 U1 build 208462
Getting somewhere now.
I am logged in to windows with an account that doesn't have vcenter access. Depsite specifying one that does when prompted in powercli, it gave the error above.
Running the actual powerCLI window as the user with access that I was specifying before, does work.
It looks as if your using SSPI to logon to the vCenter.
When your current account has access to vCenter you can leave out the -Credential parameter.
But only the first time for a PowerCLI session due to a bug. Subsequent connect you have to use the -Credential parameter as a bypass for this bug.
Are you 100% sure you are entering the corret account in the Get-Credential popup ?
Do you include a domain name in the user field, i.e. domain\user ?
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Positive I was using the right account. There are two in this case. One has local admin rights on the vcenter server itself, which I was logged on with. One has access to vCenter app. Running powercli window as teh first and then specifying the second didn't work. Doing a RunAs on the powercli window as the second user worked fine.
There was 1 mention of a similar problem in an older PowerCLI build, see .
In that thread it seems a DLL was missing.
Could you eventually try to uninstall/install PowerCLI and check if that makes a difference ?
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference