Loading |
VBScript |
JavaScript |
Powershell |
Search Options: Filter Computers by NameContent of Filter Computers by Name.ps1MD5 Hash: C2277F77C23DAE7164AB275C080BE0C5 |
||
$strBase = " $strFilter = "(&(objectCategory=computer)(name=Munich))" $strAttributes = "name, distinguishedName" $strScope = "subtree" $strQuery = "$strBase;$strFilter;$strAttributes;$strScope" $objConnection = New-Object -comObject "ADODB.Connection" $objCommand = New-Object -comObject "ADODB.Command" $objConnection.Open("Provider=ADsDSOObject;") $objCommand.ActiveConnection = $objConnection $objCommand.CommandText = $strQuery $objRecordSet = $objCommand.Execute() Do { $objRecordSet.Fields.item("name") |Select-Object Name,Value $objRecordSet.Fields.item("distinguishedName") |Select-Object Name,Value $objRecordSet.MoveNext() } Until ($objRecordSet.eof) $objConnection.Close() | ||
© 2008 - 2013 Boris Toll :: Scripts available: 6.481 :: :: scriptbox.toll.at :: :: powered by www.toll.at :: |