VMware Cloud Community
DDHB
Contributor
Contributor
Jump to solution

Query if ESXi is joined into AD domain

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

0 Kudos
1 Solution

Accepted Solutions
daphnissov
Immortal
Immortal
Jump to solution

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

------                         ----------------------         --------------

View solution in original post

0 Kudos
3 Replies
daphnissov
Immortal
Immortal
Jump to solution

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

------                         ----------------------         --------------

0 Kudos
DDHB
Contributor
Contributor
Jump to solution

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

0 Kudos
daphnissov
Immortal
Immortal
Jump to solution

I don't think that attribute is exposed with Get-View taking the input object of a VMHost.

0 Kudos