Get-ADSystemInfo – Wrapping the ADSystemInfo ComObject

When I was writing in vbscript, I often used the ADSystemInfo ComObject.  It is a quick and easy way to get these properties:  Current user’s distinguished name, Current computer’s distinguished name, the site name, the Domain short (NetBIOS) Name,  the domain DNSName,  the forest DNSName,  the PDC Role Owner,  the Schema Role Owner, and whether the domain is running in Native Mode.  The script on TechNet doesn’t “marshall” (cleanup) after the Com object is used.  My version, Get-ADSystemInfo.ps1, makes this an advanced function with the proper cleanup.

Script Text

About Alan

See http://www.akaplan.com/blog/about/
This entry was posted in Functions, PowerShell, Scripting and tagged , , . Bookmark the permalink.

Leave a Reply