#######################################
# Skrypt PowerShella
# (C) dr Holger Schwichtenberg
# http://www.powershell-doktor.de
########################################

$Root = "LDAP://www.trustcenter.de"
$Filter = "(sn=sch*)"
$Attribute = "mail","sn"
$Scope = "subtree"

# Ceeate search
$Searcher = New-Object DirectoryServices.DirectorySearcher($Root)
$searcher.SearchRoot = $Root
$searcher.PageSize = 1000 
$searcher.Filter = $Filter
$searcher.SearchScope = $Scope 
$Attribute | foreach {[void]$searcher.PropertiesToLoad.Add($_)} 
# Execute Search
$searcher.FindAll()

"OK"