Forum Discussion

xoxidein's avatar
xoxidein
Iron Contributor
Jul 15, 2022
Solved

Output AD User Details as List

I'm trying to build a script that will let me list and add proxy addresses for users. Right now I'm just trying to get it to list (as a list, not a string) the proxy address for a user:   #Define...
  • Harm_Veenstra's avatar
    Jul 15, 2022

    xoxidein I changed your script a little bit:

     

    #Define Target User
    Write-Host "`nEnter the target username: " -ForegroundColor "Yellow" -NoNewLine
    $username = Read-Host 
    
    #List existing addresses
    Get-ADUser -Identity $username -Properties proxyaddresses | Select-Object -ExpandProperty proxyaddresses

    The `n does a new-line and instead of format-table I used Select-Object -ExpandProperty. Output is like this:
    email address removed for privacy reasons
    email address removed for privacy reasons
    email address removed for privacy reasons