Saturday, March 23, 2013

ADSI getting the current domain


Really easy to get the active domain:

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

No comments:

Post a Comment