Share via

Get user administrators between to dates

Tomás Esteban Corey Armas 21 Reputation points
2020-11-04T10:06:34.577+00:00

Hello,
I need to know who users are administrators between two dates. For example

administradores of domain for time 01/01/2020 a 09/30/2020 for example.

I try with createddate but the requirements is not created. Only who users are admin in time period.

Regards,
Tomás Esteban Corey

Windows for business | Windows Client for IT Pros | Directory services | Active Directory
Windows for business | Windows Server | User experience | PowerShell
0 comments No comments

Answer accepted by question author

SChalakov 10,781 Reputation points MVP Volunteer Moderator
2020-11-04T10:28:29.353+00:00

Hi Tomás,

group membership chnages in AD are recorded in the form of Audit Events with their respective ID. So you need to enable Auditing (or ensure it is enabled), so that you can get this information in your Security Events Logs. After that it is mainly about parsing Event Logs with PowerShell. I tried to select a couple of useful resources on the topic. The first thing is enabling this auditing setting:

How to Track and Audit Active Directory Group Membership Changes
https://www.lepide.com/how-to/track-and-audit-active-directory-group-membership-changes.html#:~:text=Event%20ID%204728%20indicates%20a,in%20Active%20Directory%20Group%20Memberships

and also to the second part - parsing. There are some very intersting blogs that will give you an idea on what exactly has to be done:

Use PowerShell Cmdlet to Filter Event Log for Easy Parsing
https://devblogs.microsoft.com/scripting/use-powershell-cmdlet-to-filter-event-log-for-easy-parsing/

Use PowerShell to parse event log for shutdown events
https://devblogs.microsoft.com/scripting/use-powershell-to-parse-event-log-for-shutdown-events/

PowerShell – Everything you wanted to know about Event Logs and then some
https://evotec.xyz/powershell-everything-you-wanted-to-know-about-event-logs/

I hope I was able to help you out!


(If the reply was helpful please don't forget to upvote or accept as answer, thank you)
Regards,
Stoyan

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Tomás Esteban Corey Armas 21 Reputation points
    2020-11-04T11:55:39.537+00:00

    Hi Stoyan,

    Thanks for your reply, its very useful.

    regards,
    Tomás

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.