locked
Looking to find AD users with anything in Address list RRS feed

  • Question

  • I am looking to find any AD user that has a address in the field. I would like to input the results in a CSV. I know how to do this if I was looking to import all users that were lets say part of a specific office but I am not sure how to do it if they have anything in a specific field. I am thinking it will go like this:

    get-aduser -filter {address -eq '???'} | export-csv C:\asdf\asdf\asdf.csv

    Wednesday, February 12, 2014 5:16 PM

Answers

  • The address tab in ADUC is made up of several properties - StreetAddress, POBox, City, State, PostalCode, and Country.
    Get-ADUser -Identity username -Properties * | Select-Object Name,StreetAddress,POBox,City,State,PostalCode,Country

    To find all the users in AD that have an entry in the Address field (StreetAddress property) then see the example below. This will only look in the StreetAddress property, not any of the other fields that make up the Address tab.

    Get-ADUser -Filter {StreetAddress -like "*"}


    • Marked as answer by bohlingj Wednesday, February 12, 2014 5:41 PM
    Wednesday, February 12, 2014 5:40 PM

All replies

  • Hi,

    Which field are you looking to get information for?


    Don't retire TechNet! - (Don't give up yet - 12,575+ strong and growing)

    Wednesday, February 12, 2014 5:33 PM
  • The Address field. If there is any text under the address field I would like to export it to a CSV
    Wednesday, February 12, 2014 5:37 PM
  • The address tab in ADUC is made up of several properties - StreetAddress, POBox, City, State, PostalCode, and Country.
    Get-ADUser -Identity username -Properties * | Select-Object Name,StreetAddress,POBox,City,State,PostalCode,Country

    To find all the users in AD that have an entry in the Address field (StreetAddress property) then see the example below. This will only look in the StreetAddress property, not any of the other fields that make up the Address tab.

    Get-ADUser -Filter {StreetAddress -like "*"}


    • Marked as answer by bohlingj Wednesday, February 12, 2014 5:41 PM
    Wednesday, February 12, 2014 5:40 PM
  • I am still a little confused.

    Get-ADUser -Identity username -Properties * | Select-Object Name,StreetAddress,POBox,City,State,PostalCode,Country

    That is what I want but instead of a specific username what would I add for everyone?

    Wednesday, February 12, 2014 5:48 PM
  • I am still a little confused.

    Get-ADUser -Identity username -Properties * | Select-Object Name,StreetAddress,POBox,City,State,PostalCode,Country

    That is what I want but instead of a specific username what would I add for everyone?

    Get-ADUser -Filter {StreetAddress -like "*"} -Properties * | Select-Object Name,StreetAddress,POBox,City,State,P
    ostalCode,Country



    Wednesday, February 12, 2014 5:54 PM
  • get-aduser -filter {address -like '*'}


    ¯\_(ツ)_/¯

    Wednesday, February 12, 2014 6:47 PM