none
AD users list

    Question

  • Hi Guys,

    How to export Active directory users created,modified date and time list for all the particular OU???

     

    I need above information for all users in particular OU... ???
    Monday, January 30, 2017 12:14 PM

Answers

  • Hi,

    Something like this might help

    Get-ADUser -SearchBase "OU=test,dc=testdomain,dc=local" -Filter * -ResultSetSize 200 | Get-ADObject -Properties Created,Modified | select Name, Created, Modifed

    To output to csv you could add "> testoutput.csv"

    I am no powershell expert and there may be a cleaner way however that seems to have the information you require
    Monday, January 30, 2017 12:29 PM

All replies

  • Hi,

    Something like this might help

    Get-ADUser -SearchBase "OU=test,dc=testdomain,dc=local" -Filter * -ResultSetSize 200 | Get-ADObject -Properties Created,Modified | select Name, Created, Modifed

    To output to csv you could add "> testoutput.csv"

    I am no powershell expert and there may be a cleaner way however that seems to have the information you require
    Monday, January 30, 2017 12:29 PM
  • Thanks Sam,,

    Its working perfectly.. Thank you so much..

    Monday, January 30, 2017 1:35 PM
  • There is no need to pipe to Get-ADObject. The Get-ADUser cmdlet can retrieve the attributes.

    Get-ADUser -SearchBase "OU=test,dc=testdomain,dc=local" -Filter * -Properties Created, Modified | select Name, Created, Modifed


    Richard Mueller - MVP Enterprise Mobility (Identity and Access)

    Monday, January 30, 2017 1:46 PM
  • I have one more doubt 

    how to get UID in Active Directory ???

    Monday, January 30, 2017 1:59 PM
  • There are two attributes, uid and uidNumber. You can add them to the -Properties parameter and the following Select. For example:

    Get-ADUser -SearchBase "OU=test,dc=testdomain,dc=local" -Filter * -Properties Created, Modified, uid, uidNumber | select Name, Created, Modifed, uid, uidNumber


    Richard Mueller - MVP Enterprise Mobility (Identity and Access)

    Monday, January 30, 2017 2:13 PM