Dear All,
How to connect mulitple esx, i am writing a script to connect multiple esx at one time and get vmhost detials.
i tried like this in my script .
$esx = (Get-Content "C:\Desktop\vmlist.txt") Connect-VIServer $esx
how to connect with credentials . please guide me to resolve this thread.
Then you should be able to do
$esx = Get-Content "C:\Desktop\vmlist.txt"
Connect-VIServer $esx -User YourUser -Password YourPassword
To avoid having the password in clear text, you can also use the Credential parameter
$esx = Get-Content "C:\Desktop\vmlist.txt"
Connect-VIServer $esx -Credential $cred
There are many ways to get the credentials into the $cred variable..
Alan discusses the VICredentialStore in his Back to Basics: Connecting to vCenter or a vSphere Host post.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
You can do
$esx = Get-Content "C:\Desktop\vmlist.txt"
Connect-VIServer $esx
but that is without the credentials.
Do you have the same credentials for each host ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
yes lucd for all esx i have same credentials.
Then you should be able to do
$esx = Get-Content "C:\Desktop\vmlist.txt"
Connect-VIServer $esx -User YourUser -Password YourPassword
To avoid having the password in clear text, you can also use the Credential parameter
$esx = Get-Content "C:\Desktop\vmlist.txt"
Connect-VIServer $esx -Credential $cred
There are many ways to get the credentials into the $cred variable..
Alan discusses the VICredentialStore in his Back to Basics: Connecting to vCenter or a vSphere Host post.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks lucd,
Its working great. if you are free kindly answer my previous post.
You mean this post Re: ESX / DATASTORE details in inventory list. ?
I'm pretty sure Matt you will reply to your questions when he is online (remember the timezones :smileygrin:)
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
yes 🙂 i am trying from yesterday, i dnt know why the empty spaces coming. in the ip field for most of the esx iam getting the same. 😞