Schlagwort: AD

  • Powershell for getting a CSV Adressbook out of an Active-Directory

    This is a little reminder to myself on how-to get a CSV list out of an standard Active Directory/ldap: [string] $ldapFilter = „(&(objectClass=User)(!(objectClass=Computer))(displayName=*, *)(telephonenumber=*))“; [string[]] $propLoad = @(„displayname“, „telephoneNumber“); [System.DirectoryServices.DirectoryEntry] $baseDn = New-Object „System.DirectoryServices.DirectoryEntry“ „LDAP://ldap…“; [System.DirectoryServices.DirectorySearcher] $searcher = New-Object „System.DirectoryServices.DirectorySearcher“ $baseDn, $ldapFilter, $propLoad, 2 $searcher.PageSize = [Int32]::MaxValue; [System.DirectoryServices.SearchResult] $result = $null; [string[]] $resultList = @();…