If I connect to a single ESXi host using SSH and run the command ntpq -p, I get the output as below :
I know I can get the configured NTP server and the service running status using RV Tools however I am looking for a script to pull all the details seen in the above screenshot from all the ESXi hosts in a vCenter. I am not good in scripting and still learning it.
Can anyone please help me with a script so that I can connect to the vCenter and run that to get the output in a file for all the hosts ?
Any help would be really appreciable.
Thanks in advance!
Akshay Kirty
Those are quite a few errors.
First let us find out what environment you are using.
Run the following
$PSVersionTable
Get-Module -Name VMware.PowerCLI -ListAvailable
Did you actually install the module Posh-SSH from the PowerShell Gallery?
Do a
If nothing is returned, do a
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Seems the Posh-SSH module is not installed and the Jump box don't have the internet connectivity:
I have manually downloaded the .nupkg for Posh-SSH. Do i need to import it in PowerCli ?
Thanks,
Akshay
If you place the module in one of the folders in $env:PSModulePath, then PS will find the module.
Btw, from a station with Internet connecvity you can do Save-Module.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Wow....It worked, finally got what I was looking for in the report.
I put the extracted module in the module path, that's it.
Thank you so much....really appreciate your efforts in this, considering I didn't know much about scripting.
Thank you
Akshay Kirty