Created
February 26, 2022 10:28
-
-
Save jfmaes/404b45d542fc07db51e6e07d8ebb79b9 to your computer and use it in GitHub Desktop.
Invoke-SyncMeUp.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Invoke-SyncMeUp{ | |
[CmdletBinding()] | |
Param ( | |
[Parameter(Mandatory=$True)] | |
[string]$AccountName | |
) | |
$dse = [ADSI]"LDAP://Rootdse" | |
$namingcontext = $dse.defaultNamingContext | |
echo "Giving $AccountName DCSync rights" | |
dsacls.exe $namingcontext /G $AccountName":CA;Replicating Directory Changes All" $AccountName":CA;Replicating Directory Changes" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment