The following PowerShell script will create a number of Policy Containers in the Active Roles Configuration. This script can be copied into the PowerShell ISE or the Active Roles Management Shell. To prevent any permissions-related errors, this script should be executed on the Publisher as an Active Roles Admin:
Import-Module ActiveRolesManagementShell
Connect-QADService -Proxy
$numberOfObjectsToCreate = 1..100 #Modify this number to create more or less objects, as desired
$targetContainer = Get-QADObject "ReplicationTest" -SearchRoot "Configuration/Policies/Administration"
If(!$targetContainer)
{
New-QADObject -Type edsPolicyObjectsContainer -Name "ReplicationTest" -ParentContainer "Configuration/Policies/Administration"
}
ForEach($object in $numberOfObjectsToCreate)
{
New-QADObject -Type edsPolicyObjectsContainer -Name "ReplicationTest_$object" -ParentContainer "Configuration/Policies/Administration/ReplicationTest"
}
The following PowerShell script will delete all of the objects which were created by the above PowerShell script. This should be run on a Subscriber after replication is complete to confirm that replication is bi-directional:
Import-Module ActiveRolesManagementShell
Connect-QADService -Proxy
$targetContainer = Get-QADObject -SearchRoot "Configuration/Policies/Administration/ReplicationTest" -SearchScope OneLevel
ForEach($object in $targetContainer)
{
$object | Remove-QADObject -DeleteTree -Force
}
Get-QADObject -SearchRoot "Configuration/Policies/Administration/ReplicationTest" | Remove-QADObject -Force