Hello,
I do connect to a vcenter via connect-viserver and start querying information in different hosts and enventually send an email. But, I would like to output the vCenter hostname.
How do i output the vCenter hostname ?
Thanks for your help,
Hello, gerf0727-
Assuming that you want the name of the last vCenter to which you connected, you can use the automatic global variable "DefaultVIServer" to get the name of the vCenter to which you are connected. Access the "Name" property of this object, like:
$global:DefaultVIServer.Name
That do it?
Hello, gerf0727-
Assuming that you want the name of the last vCenter to which you connected, you can use the automatic global variable "DefaultVIServer" to get the name of the vCenter to which you are connected. Access the "Name" property of this object, like:
$global:DefaultVIServer.Name
That do it?