Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Import-Module ActiveDirectory
- Get-ADUser -Filter * -SearchBase "OU=Users,OU=Accounts,OU=centile,OU=enreach,DC=voiceworks,DC=local" -Properties proxyAddresses | ForEach {
- ForEach ($Address in $_.proxyAddresses) {
- [pscustomobject]@{
- User = $_.Name
- UPN = $_.UserPrincipalNAme
- ProxyAddress = $Address
- }
- }
- } | Export-Csv -Path "C:\Scripts\AndreB\ExportedCSVs\CENTILE-UsersProxy$(get-date -f yyyy-MM-dd-HHmmss).csv" -NoTypeInformation
Add Comment
Please, Sign In to add comment