Report of all users for Proxyaddress attribute


I need Proxyaddress attribute of all users in domain. Since there are multiple values available in this attribute i need either to get each attribute separately in column or search users with one particular value only. for an example i need all users who has proxyaddress contains ""

Thanks in advance.

  • Hi  

    The below is an example, and should be tested in a dev environment. The LDAPFilter within the Get-QADObject below will find any object that has any entry in their ProxyAddresses field where it contains (regardless of the type of Proxy Address)

    $OutPutFile = "$($env:USERPROFILE)\Desktop\ProxyAddresses.csv"
    $Objects = Get-QADObject -LdapFilter "(proxyAddresses=**)" -DontUseDefaultIncludedProperties
        "Object Name;Type;Address" | Out-File -FilePath $OutPutFile
        ForEach($Object in $Objects)
            $ObjectName = $Object.samAccountName
            ForEach($ProxyAddresses in $Objects.ProxyAddresses)
                $Address = $ProxyAddresses.split(":",[System.StringSplitOptions]::RemoveEmptyEntries)
                "$ObjectName;$($Address[0]);$($Address[1])"  | Out-File -FilePath $OutPutFile -Append
                Write-host "$ObjectName - $($Address[0]) - $($Address[1])"

    IE, if you have User1 with the following ProxyAddress, it would be picked up by the LDAPFilter



    Therefore you either need to make you're LDAP filter slightly more complete, or add a check within the loop outputting the current objects row to file, to prevent it for exporting records you don't want to see.

    Hope this helps