Monday, April 28, 2014

How to use Powershell to discover the current Domain using two lines of code

$iret = [System.Reflection.Assembly]::LoadWithPartialName("System.DirectoryServices")
$Domain = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain

No comments:

Post a Comment