Tuesday, 6 June 2023

how to find proxy address in active directory powershell using txt.

 how to find proxy address in active directory powershell using Txt.



File Format:



$users = Get-Content c:\temp\proxy\users.txt

$output = foreach ($user in $users)

{

     Get-ADUser $user  -Properties proxyAddresses | ForEach {

    ForEach ($Address in $_.proxyAddresses) {

        [pscustomobject]@{

            samaccountName = $_.SamAccountName

            ProxyAddresses = $Address

        }

    }

}

} $output | Export-Csv -Path "C:\temp\proxy\ProxyAddresses.csv" -NoTypeInformation



For all user please refer this.


https://techsol2018.blogspot.com/2023/06/how-to-find-proxy-address-in-active.html




No comments:

Post a Comment