VMware

This Question is Answered

1 "correct" answer available (10 pts) 2 "helpful" answers available (6 pts)
14 Replies Last post: Aug 7, 2009 7:24 PM by c_shanklin  

connect-viserver without typing the password posted: Aug 8, 2008 9:37 AM

Click to view owz's profile Novice 20 posts since
Aug 8, 2008

Hi,

I am new to this, just wonder is there a way the I can use connect-visserver without typing in the password, but using the use authentication that runs the script?

Currently, I am doing this and it works fine:

Connect-VIServer -Server Bla.domain.com -Password blapass

What I want to do is this

Connect-VIServer -Server Bla.domain.com

And it should log me in without asking username or password.

FYI, I am on Windowser Server 2003, 32bit machine.

Thanks,

owz


Re: connect-viserver without typing the password

1. Aug 8, 2008 9:48 AM in response to: owz
Click to view LucD's profile Champion vExpert 2,851 posts since
Oct 31, 2005
Yes, that should work. See Re: Connect-VIServer and Single Sign-on.
If the user with which you run the Connect-VIServer cmdlet has the required permissions defined on the VC it should work.

Re: connect-viserver without typing the password

3. Aug 8, 2008 2:03 PM in response to: owz
Click to view LucD's profile Champion vExpert 2,851 posts since
Oct 31, 2005
Would be usefull if you could describe your environment:
  • version VC
  • OS version + bit-mode (32/64)
  • PowerShell version

Re: connect-viserver without typing the password

5. Aug 11, 2008 11:44 AM in response to: owz
Click to view LucD's profile Champion vExpert 2,851 posts since
Oct 31, 2005
Could you also check what version of VC you're running ?
In the VI Client go to <Help><About VMware Infrastructure>.

Re: connect-viserver without typing the password

7. Aug 11, 2008 1:12 PM in response to: owz
Click to view LucD's profile Champion vExpert 2,851 posts since
Oct 31, 2005
Strange :-(

The fact that the Connect-VIServer doesn't show a port and server when you use a user and password is not normal.
When I connect I see something like this

connect.png

Re: connect-viserver without typing the password

9. Aug 11, 2008 1:38 PM in response to: owz
Click to view LucD's profile Champion vExpert 2,851 posts since
Oct 31, 2005
I see...

The error message you mentioned in the beginning is that the one about the certification chain ?
You will always get that for the first Connect-VIServer you execute from the shell.
See also my previous screenshot.
If you restart the shell it will be back.

On another track, is the checking of the host certificate disabled ?
In the VI Client go to <Administration><VirtualCenter Management Server Configuration...> and select the <SSL Settings>.
The option <Check Host Certificates> shouldn't be selected.

You could also check if there is any info in the VC logs.
In the Server Configuration panel select <Logging Options> and set it to verbose.
Then try the Connect-VIServer and check the vpxd log.
Look for entries marked with SSPI.

Re: connect-viserver without typing the password

11. Aug 15, 2008 12:02 PM in response to: owz
Click to view LucD's profile Champion vExpert 2,851 posts since
Oct 31, 2005
That is because the VMware VI Toolkit shortcut also loads the VITK snapin.
You can solve this by using the PowerShell profile.ps1 file.
Add a line like this
{noformat}
Add-PSSnapin -Name "VMware.VimAutomation.Core"
{noformat}

Re: connect-viserver without typing the password

13. Aug 15, 2008 12:21 PM in response to: owz
Click to view halr9000's profile Master vExpert 845 posts since
Jun 7, 2007
owz wrote:
Here is what I am getting if I trigger the script from regular prompt dos windows:

Just to make a small correction here for others--what he meant is PowerShell, not "dos".

Author of the upcoming book: Managing VMware Infrastructure with PowerShell
Co-Host, PowerScripting Podcast (http://powerscripting.net)

Re: connect-viserver without typing the password

14. Aug 7, 2009 7:24 PM in response to: owz
Click to view c_shanklin's profile Master VMware Employees 830 posts since
Dec 3, 2007
I'm updating this old thread because a lot of people are viewing it.

If you're looking to connect without typing a password and can't take advantage of SSPI, check out the VI Toolkit Extensions, here there is a function called Connect-Recent that can cache your credentials. I use it all the time, in fact I never use Connect-VIServer anymore.

VMware Beta Programs

Want to be Considered for Future Beta Programs?

Learn More

VMware Developer

Download SDKs, APIs, videos,
training, and more in the Developer community.

Learn More

Developer
Sample Code

Increase your developer productivity with VMware API sample code.

Learn More

VMworld
Sessions & Labs

Online access to the latest VMworld Sessions & Labs and online services.

Learn more

Purchase PSO Credits Online

Purchase credits to redeem training and consulting services online.

Buy Now

Community Hardware Software

View reported configurations or report your own.

Learn More

Only VMware ... Delivers Nexus 1000V

Ensure consistent, policy-based network capabilities to virtual machines across your data center.

Learn More

Communities