Run RSOP in PowerShell to multiple computers

If you have the need to apply any changes on multiple computers via GPO, you may find there’s a single or some computers that were not applied the changes. To start the troubleshooting, you may need to know whether the problematic computers are already GPO-applied or not. From the GUI, you can check it from the…

Replicate AD in Powershell

Here is the example command to replicate all AD in powershell command: function Replicate-AllDomainController {(Get-ADDomainController -Filter *).Name | Foreach-Object {repadmin /syncall $_ (Get-ADDomain).DistinguishedName /e /A | Out-Null}; Start-Sleep 10; Get-ADReplicationPartnerMetadata -Target “$env:userdnsdomain” -Scope Domain | Select-Object Server, LastReplicationSuccess}

Add new Domain Controller to existing domain with PowerShell

If you need the need to add a secondary domain controller, this script may help you. This script was tested with Windows Server 2016. Firstly, we need to install the ADDS server role on the server that will setup the domain controller using PowerShell: Once role is installed, we can use the following script to…