Pulling out a specific ProxyAddress from a user and export to CSV

Welcome Forums General PowerShell Q&A Pulling out a specific ProxyAddress from a user and export to CSV

  • This topic has 2 replies, 2 voices, and was last updated 4 months ago by
    Participant
    .
Viewing 2 reply threads
  • Author
    Posts
    • #178029
      Participant
      Topics: 5
      Replies: 5
      Points: 105
      Rank: Participant

      Hello all!  We have hundreds of users with a proxyaddress we are going to remove.  I can export all users with all proxyaddresses without a problem.  My question is how do export just the specific proxyaddress to csv?  Some users have over 10 total proxyaddresses.  This is the current script I am running to pull the proxyaddresses.

      
      Get-ADUser -Filter * -SearchBase 'OU=ABC,DC=com' -Properties ProxyAddresses | Select Name, @{L='ProxyAddress_1';E={$_.ProxyAddresses[0]}},@{L='ProxyAddress_2';E={$_.ProxyAddresses[1]}},@{L='ProxyAddress_3';E={$_.ProxyAddresses[2]}},@{L='ProxyAddress_4';E={$_.ProxyAddresses[3]}},@{L='ProxyAddress_5';E={$_.ProxyAddresses[4]}},@{L='ProxyAddress_6';E={$_.ProxyAddresses[5]}},@{L='ProxyAddress_7';E={$_.ProxyAddresses[6]}},@{L='ProxyAddress_8';E={$_.ProxyAddresses[7]}},@{L='ProxyAddress_9';E={$_.ProxyAddresses[8]}},@{L='ProxyAddress_10';E={$_.ProxyAddresses[9]}},@{L='ProxyAddress_11';E={$_.ProxyAddresses[10]}},@{L='ProxyAddress_12';E={$_.ProxyAddresses[11]}} | Export-Csv -Path C:\Temp\AtwaterProxy_2.csv -NoTypeInformation
      
      
    • #178317
      Participant
      Topics: 28
      Replies: 44
      Points: 165
      Rank: Participant

      I am not clear here, are you just wanting to export the addresses or get a list of the users who have that specific proxy address?

    • #178326
      Participant
      Topics: 28
      Replies: 44
      Points: 165
      Rank: Participant

      I think what you want is right here in this well written article.

      Exporting multivalued attributes with Export-CSV cmdlet

Viewing 2 reply threads
  • The topic ‘Pulling out a specific ProxyAddress from a user and export to CSV’ is closed to new replies.