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.