Qui a touché au GPO et pourquoi tout est encore en feu ?
J’ai un excellent script PowerShell/tâche planifiée que nous utilisons pour les alertes de modification de GPO. Dites-moi si vous êtes intéressé.
EDIT : Tous ceux intéressés par mon script. Je ne suis pas en mesure de le publier sur Reddit en raison de sa longueur. Un autre commentateur a gentiment suggéré d’utiliser Pastebin. Malheureusement, mon lieu de travail bloque Pastebin. Je le partagerai avec vous tous quand je serai chez moi.
Si quelqu’un d’autre veut le voir, continuez à commenter, cela me sert de bon rappel pour le partager avec vous tous.
Ah et pour info, assurez-vous d’avoir activé l’audit AD pour vos DC.
EDIT2: Here is the code. Filtered accounts can be commented out to start, but you may have some accounts you want to filter out. For example, our Exchange server farm will cause a bunch random alerts for what it does in the background to AD - I would add each computer to that array.
####################################### Declarations - Fill these out! #######################################
$filteredAccounts = @(" [ACCOUNTS YOU DO NOT WANT MONITOR")
$EmailFrom = "[email protected]"
$EmailTo = @("[email protected]", "[email protected]")
######################################## Declarations - Static ###############################################
# Initialize array for Event IDs that will be searched for
$EventIds = 5136, 5137, 5138, 5139, 5141
# Query the event log for the specified event IDs
$Events = Get-WinEvent -MaxEvents 6 -FilterHashTable @{Logname = "Security"; ID = $EventIds}
# Initialize variables for tracking if filtered and non-filtered accounts exist
$filteredAccountFound = $false
$nonFilteredAccountFound = $false
# Initialize arrays for tracking filtered and non-filtered events
$filteredAccountEvents = @()
$nonFilteredAccountEvents = @()
############################################### Inclusions ###################################################
# Include the SendEmail PowerShell script
."c:\Send-Email.ps1"
`############################################ P
(Réponse tronquée)