Get-ADUser - Account created by?

Posted on 2014-07-14
Last Modified: 2014-07-15
Hey guys, trying to run the following PS to get a list of user accounts created in the past 30 days.

Question, is there a way to pull the account/user that created the new account?

Import-Module ActiveDirectory
$date = get-date
Get-ADUser -Filter * -Properties whenCreated | Where-Object {$_.whenCreated -ge ((Get-Date).AddDays(-30)).Date} | Select GivenName, Surname, Name, UserPrincipalName, SamAccountName, whenCreated, Enabled | Export-Csv C:\Scripts\Reports\ADUsersCreatedLast30Days.csv
Question by:GCTTechs
    LVL 28

    Expert Comment

    There is a great tool you can use to find out this information if you already have the required level of auditing turned on.

    If you have not been auditing user creation etc that information might be lost to you.
    LVL 17

    Assisted Solution

    by:Premkumar Yogeswaran
    For pulling the owner of an object, we need to use Get-ACL command-let

    Open PowerShell

    ipmo activedirectory
    Set-Location AD:
    Get-Acl "Distinguished name" | Fl Path,owner

    Open in new window

    Note: If object is created by Domain Admin, then owner will be displayed as Domain Admin Else it will display the name of user created the object.
    LVL 17

    Accepted Solution

    For Bulk user:

    ipmo activedirectory
    Set-Location AD:
    Import-CSV ./User.csv | % { Get-Acl $_.UserDN | Select Path,owner | Export-Csv C:\temp\Owner_info.csv }

    Open in new window

    Note: Input should be as DN

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
    Set OWA language and time zone in Exchange for individuals, all users or per database.
    This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…
    This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now