Any prompt answer will be appreciated!!VMware PowerCLI
I assume you want to know if you can connect to an ESXi node directly with PowerCLI?
Well yes, you can.
In fact with Connect-VIServer you can connect to any vSphere server, beit a vCenter or an ESXi node.
You do of course need the credentials for that ESXi node.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I'm getting below error message while connecting to ESXI via root credentials....
PS C:\Users\S> Connect-VIServer 10.214.60.144
Connect-VIServer : 6/29/2018 5:29:31 PM Connect-VIServer Error: Invalid server certificate. Use
Set-PowerCLIConfiguration to set the value for the InvalidCertificateAction option to Prompt if you'd like to connect
once or to add a permanent exception for this server.
Additional Information: Could not establish trust relationship for the SSL/TLS secure channel with authority
'10.214.60.144'.
At line:1 char:1
+ Connect-VIServer 10.214.60.144
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : SecurityError: (:) [Connect-VIServer], ViSecurityNegotiationException
+ FullyQualifiedErrorId : Client20_ConnectivityServiceImpl_Reconnect_CertificateError,VMware.VimAutomation.ViCore.
Cmdlets.Commands.ConnectVIServer
Did you configure PowerCLI to ignore invalid certificates?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Yes it worked.. Thank You!!
Could you please let me know is there any option through which we can query host without using root credentials?
You are connecting to the ESXi node I guess then?
You can also connect to a vCenter, and then access all ESXi nodes that are known in that vCenter.
Note that some functionality requires a connection to the ESXi node.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Yeah, I'm working with lab EXSi host.
We need to have below requirement to be fulfilled by using POWERCLI.
-PING status whether the host is up or not
-To check status of important services of ESXIs
-Utilization of CPU, Memory, IOPS, Counters(Disk Queue Length)
-Disk free space(Free space of all the logical Drives)
Could you please help me getting above requirement scripts.
And would you like rice or fries with that?
Seriously, what do you already have?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Actually i'm new to PowerCLI.
If you could help .. it will be very helpful.
Sure, in fact most of the points you raise are simple cmdlets.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thank you so much for sharing below..
These worked on Wednesday when I restarted my pc don't know why it's not working and giving below error message.. Could you please take a look and suggest what to do?
PS C:\Users\S> Connect-VIServer '10.21.60.1' -user root -password W@123
Connect-VIServer : Could not load file or assembly 'VMware.Vim, Version=6.7.0.1174, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file
specified.
At line:1 char:1
+ Connect-VIServer '10.21.60.1' -user root -password W@123
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Connect-VIServer], FileNotFoundException
+ FullyQualifiedErrorId : System.IO.FileNotFoundException,VMware.VimAutomation.ViCore.Cmdlets.Commands.ConnectVIServer
Looks like your PowerCLI installation might be corrupted.
Do you perhaps still have part of an MSI-based install on the system, mixed with an install from the PowerShell Gallery?
What does this return?
Get-PSSnapin -Registered
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
On powerCLI and powerShell returning the same as below
PS C:\Users\S1007339> Get-Module -Name VMware* -ListAvailable
Directory: C:\Users\S\Documents\WindowsPowerShell\Modules
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 6.7.0.8... VMware.DeployAutomation {Add-DeployRule, Add-ProxyServer, Add-ScriptBundle, Copy-DeployRule...}
Script 6.7.0.8... VMware.ImageBuilder {Add-EsxSoftwareDepot, Add-EsxSoftwarePackage, Compare-EsxImageProfile, ...
Manifest 10.1.1.... VMware.PowerCLI
Script 6.7.0.8... VMware.Vim
Script 10.1.0.... VMware.VimAutomation.Cis.Core {Connect-CisServer, Disconnect-CisServer, Get-CisService}
Script 10.0.0.... VMware.VimAutomation.Cloud {Add-CIDatastore, Connect-CIServer, Disconnect-CIServer, Get-Catalog...}
Script 10.1.0.... VMware.VimAutomation.Common
Script 10.1.0.... VMware.VimAutomation.Core {Add-PassthroughDevice, Add-VirtualSwitchPhysicalNetworkAdapter, Add-VMH...
Script 6.5.4.7... VMware.VimAutomation.HA Get-DrmInfo
Script 7.5.0.8... VMware.VimAutomation.HorizonView {Connect-HVServer, Disconnect-HVServer}
Script 10.0.0.... VMware.VimAutomation.License Get-LicenseDataManager
Script 10.1.0.... VMware.VimAutomation.Nsxt {Connect-NsxtServer, Disconnect-NsxtServer, Get-NsxtService}
Script 10.0.0.... VMware.VimAutomation.PCloud {Connect-PIServer, Disconnect-PIServer, Get-PIComputeInstance, Get-PIDat...
Script 10.1.0.... VMware.VimAutomation.Sdk {Get-PSVersion, Get-InstallPath}
Script 10.0.0.... VMware.VimAutomation.Srm {Connect-SrmServer, Disconnect-SrmServer}
Script 10.1.0.... VMware.VimAutomation.Storage {Add-KeyManagementServer, Copy-VDisk, Export-SpbmStoragePolicy, Get-KeyM...
Script 1.2.0.0 VMware.VimAutomation.StorageUtility Update-VmfsDatastore
Script 10.1.0.... VMware.VimAutomation.Vds {Add-VDSwitchPhysicalNetworkAdapter, Add-VDSwitchVMHost, Export-VDPortGr...
Script 10.0.0.... VMware.VimAutomation.Vmc {Connect-Vmc, Disconnect-Vmc, Get-VmcService, Connect-VmcServer...}
Script 10.0.0.... VMware.VimAutomation.vROps {Connect-OMServer, Disconnect-OMServer, Get-OMAlert, Get-OMAlertDefiniti...
Script 6.5.1.7... VMware.VumAutomation {Add-EntityBaseline, Copy-Patch, Get-Baseline, Get-Compliance...}
PS C:\Users\S> Get-PSSnapin -Registered
Name : VMware.DeployAutomation
PSVersion : 2.0
Description : Cmdlets for Rule-Based-Deployment
Name : VMware.ImageBuilder
PSVersion : 2.0
Description : This Windows PowerShell snap-in contains VMware ESXi Image Builder cmdlets used to generate custom images.
Name : VMware.VimAutomation.Core
PSVersion : 2.0
Description : This Windows PowerShell snap-in contains Windows PowerShell cmdlets for managing vSphere.
Name : VMware.VimAutomation.License
PSVersion : 2.0
Description : This Windows Powershell snap-in contains cmdlets for managing License components.
That's what I was afraid off, you have 2 versions of PowerCLI intermixed.
You should uninstall both versions, and reinstall the latest from the PowerShell Gallery.
You will find most of these instructions as well in
Welcome PowerCLI to the PowerShell Gallery - Install Process Updates
PowerCLI Offline Installation Walkthrough
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
What duplicate entries do you get?
How are you creating the report? I would need to see the code.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thank you so much for all your help!!
Is there any option so that we login to ESXI and check the status of VC(If VCenter server is shutdown stage)??
If you know on which ESXi node the vCenter is running, you can do a Connect-VIServer to that ESXi node.
And then with Get-VM query the state of the vCenter VM
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference