Scripting RODC Account Creation with Windows PowerShell

Updated: August 1, 2008

Applies To: Windows Server 2008

This topic provides an example of how you can automate RODC account creation by using Windows PowerShell™ commands. Windows PowerShell is available as a free download. For more information about downloading and installing Windows PowerShell, see How to Get Windows PowerShell 1.0 ( For more information about how to use Windows PowerShell, see Scripting with Windows PowerShell (

Create a comma-separated-value (CSV) file. You can use Microsoft Excel to create a CSV file. For example, create the following file and save it as test.csv. You can use this file to create three read-only domain controller (RODC) accounts. Each RODC account specifies a delegated RODC administration account, a designated replication partner to use during the installation, and a site name.


In a Windows PowerShell command window, run the following command to create the three RODC accounts:

Import-csv test.csv -Delimiter ';'  | foreach -process { $domainFQDN = $_.domainFQDN; $RODCName = $_.RODCName ; $delegatedAdmin  = $_.delegatedAdmin ; $ReplicationPartner = $_.ReplicationPartner; $SiteName  = $_.SiteName ; Dcpromo /unattend /createDCaccount /ReplicaDomainDNSName:$domainFQDN /DCAccountName:$RODCName /InstallDNS:Yes /ConfirmGC:Yes /delegatedAdmin:$delegatedAdmin  /ReplicationSourceDC:$ReplicationPartner /SiteName:$SiteName }

You can customize the commands to do additional tasks, such as create site links, configure site link properties, and so on. For example, you can specify the Password Replication Policy (PRP) so that the delegated RODC administrator account is cacheable:

/PasswordReplicationAllowed {TO DO} /PasswordReplicationDenied {TO DO}

Community Additions