WMI and Trusts

When you install AD on a machine you get the MicrosoftActiveDirectory WMI namespace as well. This namespace was deprecated in Windows 2012 but while it is still available there are few useful things we can do with it. Even with my fondness of WMI I’m not suggesting moving to using WMI wholesale for AD admin but one of the more useful things is testing a trust’s status.

PS> Get-CimInstance -ClassName Microsoft_DomainTrustStatus -Namespace root\MicrosoftActiveDirectory |
select Flatname, Trust*


Flatname          : SPHINX
TrustAttributes   : 8
TrustDirection    : 3
TrustedDCName     :
TrustedDomain     : sphinx.org
TrustIsOk         : False
TrustStatus       : 1355
TrustStatusString : The specified domain either does not exist or could not be contacted.
TrustType         : 2


The error messages are because the VM hosting the remote domain is switched off.  If you want a quick test of your trust status this is a good way.

This entry was posted in Active Directory, PowerShell and WMI, Windows Server 2012. Bookmark the permalink.

3 Responses to WMI and Trusts

  1. cavallogolooso says:

    Get-CimInstance was unrecognized command on Vista (32) …

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s