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…
Tag: COMObject
Get COM Object Constants with PowerShell
I avoid using COM objects whenever I can. One of the annoyances is that you need to look up the value of constants. Shay Levy, in http://www.powershellmagazine.com/2013/03/20/pstip-working-with-excel-constants/ has a script which demonstrates how to enumerate the constants for the Excel COM object. Get-COMConstants.ps1, is an advanced function generalization, which can be used for any COM…