Loading |
VBScript |
JavaScript |
Powershell |
Search Options: Search for All the Users in a Specified OUContent of Search for All the Users in a Specified OU.ps1MD5 Hash: 75F639C1C44291A049D34C7815E79AF3 |
||
$strFilter = "(objectCategory=User)"
$objOU = New-Object System.DirectoryServices.DirectoryEntry("LDAP://OU=Finance,dc=fabrikam,dc=com"") $objSearcher = New-Object System.DirectoryServices.DirectorySearcher $objSearcher.SearchRoot = $objDomain $objSearcher.SearchScope = "Base" $objSearcher.PageSize = 1000 $objSearcher.Filter = $strFilter $colProplist = "name" foreach ($i in $colPropList){$objSearcher.PropertiesToLoad.Add($i)} $colResults = $objSearcher.FindAll() foreach ($objResult in $colResults) {$objItem = $objResult.Properties; $objItem.name} | ||
© 2008 - 2013 Boris Toll :: Scripts available: 6.481 :: :: scriptbox.toll.at :: :: powered by www.toll.at :: |