Skip to content

Instantly share code, notes, and snippets.

@jfmaes
Created February 26, 2022 10:28
Show Gist options
  • Save jfmaes/404b45d542fc07db51e6e07d8ebb79b9 to your computer and use it in GitHub Desktop.
Save jfmaes/404b45d542fc07db51e6e07d8ebb79b9 to your computer and use it in GitHub Desktop.
Invoke-SyncMeUp.ps1
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