VMware Cloud Community
peter79
Enthusiast
Enthusiast
Jump to solution

Cant connect to an ESX host with PowerCLI

Guys,

I've had no problems connecting to the VC's in my enviroment using PowerCLI.  However when ever I try to use connect-viserver

I get an error message saying my password or user name is incorrect.  I'm using the root credentails fro the host and I know there are correct but I just cant connect.

Anyone have any ideas whats wrong?

Reply
0 Kudos
1 Solution

Accepted Solutions
nnedev
VMware Employee
VMware Employee
Jump to solution

Use single quotes(') not double quoutes("). They have different meaning in PowerShell context Smiley Happy

Here is your fix:

$pass='!ITAdminE$X4!'

Regards,

Nedko Nedev

PowerCLI Development team

Regards, Nedko Nedev PowerCLI Development Team

View solution in original post

Reply
0 Kudos
7 Replies
LucD
Leadership
Leadership
Jump to solution

Are these ESX or ESXi hosts ?

If they are ESXi hosts, is the Lockdown Mode perhaps enabled ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
peter79
Enthusiast
Enthusiast
Jump to solution

They are all ESX 4.1 hosts.

Reply
0 Kudos
nnedev
VMware Employee
VMware Employee
Jump to solution

Hi,

Can you connect using VMware vSphere Client?

If you can the problem with PowerCLI is most likely that you hava e special symbols in your password. You can use the following syntaxt to escape the chars:

$pass = 'pa$$word'

I hope this helps.

Regards,

Nedko Nedev

PowerCLI Develpment Team

Regards, Nedko Nedev PowerCLI Development Team
Reply
0 Kudos
peter79
Enthusiast
Enthusiast
Jump to solution

You may have hit the nail on the head there the root password contains $

I followed your directions and typed the following

$pass="!ITAdminE$X4!"

connect-viserver 10.45.1.1 -User root -Password pass

BUt still got the same error and I have confirmed that I can connect directly to the host with the vSphere client.

Thanks.  

Reply
0 Kudos
nnedev
VMware Employee
VMware Employee
Jump to solution

Use single quotes(') not double quoutes("). They have different meaning in PowerShell context Smiley Happy

Here is your fix:

$pass='!ITAdminE$X4!'

Regards,

Nedko Nedev

PowerCLI Development team

Regards, Nedko Nedev PowerCLI Development Team
Reply
0 Kudos
peter79
Enthusiast
Enthusiast
Jump to solution

Thanks dude.  I'm still getting to grips with this powershell stuff.  

Reply
0 Kudos
nnedev
VMware Employee
VMware Employee
Jump to solution

You are welcome.

Regards,

Nedko Nedev

PowerCLI Development Team

Regards, Nedko Nedev PowerCLI Development Team
Reply
0 Kudos