Hi,
I've seen plenty of posts on how to use PowerCLI to un/re/join a host into AD domain, but nothing on how to query the host if it's already part of any domain. Ideally there is something in get-view, but I can live with other methods too.
Thanks
Use the Get-VMHostAuthentication cmdlet and it'll show you this information. Compare the output when I pipe in the VMHost object of two hosts; one is joined to AD and the other is not.
PS C:\Users\Chip> get-vmhost esxi03.zoller.com | Get-VMHostAuthentication
Domain DomainMembershipStatus TrustedDomains
------ ---------------------- --------------
ZOLLER.COM Ok
PS C:\Users\Chip> get-vmhost esxi02.zoller.com | Get-VMHostAuthentication
Domain DomainMembershipStatus TrustedDomains
------ ---------------------- --------------
Use the Get-VMHostAuthentication cmdlet and it'll show you this information. Compare the output when I pipe in the VMHost object of two hosts; one is joined to AD and the other is not.
PS C:\Users\Chip> get-vmhost esxi03.zoller.com | Get-VMHostAuthentication
Domain DomainMembershipStatus TrustedDomains
------ ---------------------- --------------
ZOLLER.COM Ok
PS C:\Users\Chip> get-vmhost esxi02.zoller.com | Get-VMHostAuthentication
Domain DomainMembershipStatus TrustedDomains
------ ---------------------- --------------
I'm a big fan of get-view due to speed but this will do. Any idea if this can be pulled with get-view?
Thanks
I don't think that attribute is exposed with Get-View taking the input object of a VMHost.