Skip to content

Instantly share code, notes, and snippets.

View zjorz's full-sized avatar

Jorge de Almeida Pinto | IAMTEC zjorz

View GitHub Profile
@zjorz
zjorz / Creating-Linking-Configuring-GPO-With-A-Scheduled-Task-For-Password-Sync-From-DSRM-Placeholder-Account.ps1
Last active June 23, 2026 20:18
Code to Create, Link & Configure a GPO With A Scheduled Task For Password Sync From DSRM Placeholder Account.ps1
# SOURCE: https://gist.github.com/zjorz/a345b5c189959a1db3ed8a4056091942
Invoke-Command -ScriptBlock {
Clear-Host
$scriptMode = "ADSIorSDSP" # "ADSIorSDSP" Or "ADPoSH"
Write-Host ""
Write-Host "###########################################################################################" -Foregroundcolor Yellow
@zjorz
zjorz / Creating-And-Configuring-The-AuthN-Policy-For-DSRM-Placeholder-Accounts.ps1
Last active June 4, 2026 20:00
Creating And Configuring The AuthN Policy For DSRM Placeholder Accounts
# SOURCE: https://gist.github.com/zjorz/061e56de829e82e86005aed6dd07b6e7/
Invoke-Command -ScriptBlock {
Clear-Host
$scriptMode = "ADSIorSDSP" # "ADSIorSDSP" Or "ADPoSH"
Write-Host ""
Write-Host "###############################################################################" -Foregroundcolor Yellow
@zjorz
zjorz / Triggering-Scheduled-Task-On-DCs-On-Demand-To-Initiate-DSRM-Password-Sync.ps1
Last active June 23, 2026 22:19
Triggering Scheduled Task On DCs On Demand To Initiate DSRM Password Sync
# SOURCE: https://gist.github.com/zjorz/93f5407552d30c70378384962c079fb4/
Invoke-Command -ScriptBlock {
Clear-Host
$scriptMode = "ADSIorSDSP" # "ADSIorSDSP" Or "ADPoSH"
Write-Host ""
Write-Host "###############################################################################" -Foregroundcolor Yellow
@zjorz
zjorz / Displaying-DSRM-Sync-State-Across-All-DCs-In-AD-Domain.ps1
Last active June 23, 2026 23:01
Displaying The DSRM Sync State Across All DCs In The AD Domain
# SOURCE: https://gist.github.com/zjorz/aa9a8d8edc4da25043a0a757aee22006/
Invoke-Command -ScriptBlock {
Clear-Host
$scriptMode = "ADSIorSDSP" # "ADSIorSDSP" Or "ADPoSH"
Write-Host ""
Write-Host "###############################################################################" -Foregroundcolor Yellow
@zjorz
zjorz / Resetting-The-DSRM-Placeholder-Account-Password-For-RODCs.ps1
Last active June 5, 2026 14:26
Code to be used in the process to reset the DSRM Placeholder Account password while removing (allowing sync) or adding (denying sync) restrictions
# SOURCE: https://gist.github.com/zjorz/fc6a4f33539fcfaaa11a6c11c564f37d/
Invoke-Command -ScriptBlock {
Clear-Host
$scriptMode = "ADSIorSDSP" # "ADSIorSDSP" Or "ADPoSH"
Write-Host ""
Write-Host "###############################################################################" -Foregroundcolor Yellow
@zjorz
zjorz / Resetting-The-DSRM-Placeholder-Account-Password-For-RWDCs.ps1
Last active June 5, 2026 14:33
Code to be used in the process to reset the DSRM Placeholder Account password while removing (allowing sync) or adding (denying sync) restrictions
# SOURCE: https://gist.github.com/zjorz/2f22beabedb1f0f68e172a1c6377842f/
Invoke-Command -ScriptBlock {
Clear-Host
$scriptMode = "ADSIorSDSP" # "ADSIorSDSP" Or "ADPoSH"
Write-Host ""
Write-Host "###############################################################################" -Foregroundcolor Yellow
@zjorz
zjorz / Creating-And-Configuring-The-PSO-For-DSRM-Placeholder-Accounts.ps1
Last active June 4, 2026 19:59
Creating And Configuring The PSO For DSRM Placeholder Accounts
# SOURCE: https://gist.github.com/zjorz/83523ecb5cdffa974e959f280ab3469b/
Invoke-Command -ScriptBlock {
Clear-Host
$scriptMode = "ADSIorSDSP" # "ADSIorSDSP" Or "ADPoSH"
Write-Host ""
Write-Host "###############################################################################" -Foregroundcolor Yellow
@zjorz
zjorz / SYNC_DSRM_ACCOUNT_PASSWORD.PS1
Last active June 5, 2026 10:10
Code to sync password from DSRM Placeholder Account in AD to the local DSRM Admin Account on DCs
# SOURCE: https://gist.github.com/zjorz/6a565db8d49e43b86fc965fc08331e24/
Invoke-Command -ScriptBlock {
Clear-Host
$scriptMode = "ADSIorSDSP" # "ADSIorSDSP" Or "ADPoSH"
Write-Host ""
Write-Host "###############################################################################" -Foregroundcolor Yellow
@zjorz
zjorz / Permission-Private-Key-Associated-Certificate-For-Specific-Account.ps1
Created October 4, 2025 20:23
Permission The Private Key Associated With A Certificate With Allow:Read For A Specific Account
$action = "<ACTION TO EXECUTE>" # "SET" OR "CHECK" <= CONFIGURE THIS!!!!!
$account = "<DOMAIN>\<SAMACCOUNTNAME>" # <= CONFIGURE THIS!!!!!
$certificateThumbprint = "<CERTIFICATE THUMBPRINT>" # <= CONFIGURE THIS!!!!!
$certStoreLocation = "Cert:\LocalMachine\My"
Invoke-Command -ArgumentList $action,$account,$certificateThumbprint,$certStoreLocation -ScriptBlock {
Param (
$action,
$account,
$certificateThumbprint,
# SOURCE: https://gist.github.com/zjorz/d3221678d2fa4f4579f4c35eefd39333/
Invoke-Command -ScriptBlock {
Clear-Host
$scriptMode = "ADSIorSDSP" # "ADSIorSDSP" Or "ADPoSH"
Write-Host ""
Write-Host "###############################################################################" -Foregroundcolor Yellow