B.3 Domain Operations

The following sections provide the scriptable operations that can be carried out on the domain object.

B.3.1 Create Offline Policy Container Hierarchy

Run the NQCreateOfflinePolicyContainerHierarchy.exe file to create a temporary copy of the settings information of all GPOs in the GP Repository. GPA automatically creates the offline policy container hierarchy when you add domains to the GP Repository. This only works for domains that have a trust relationship with the repository member domain.

To run the NQCreateOfflinePolicyContainerHierarchy.exe file, you should have Domain Admin permissions in the domain for which you want to create the offline policy container hierarchy.

The NQCreateOfflinePolicyContainerHierarchy.exe file displays a status report in the command prompt window as it runs. After execution, the NQCreateOfflinePolicyContainerHierarchy.exe file creates a log that lists the domains it successfully recreated and those domains it failed to recreate. The log displays the “ATTENTION REQUIRED” text next to the domain name of any domain the tool failed to recreate.

Syntax

NQCreateOfflinePolicyContainerHierarchy /D:Domain_DNS_Name 
/S:Repository_Server /DB:DatabaseName

Options

The following table describes the command-line parameters and variables.

Variable Name

Replace With

/D: Domain_DNS_Name

DNS name of the evaluation domain, such as abc.xyz. If you specify the domain name, then GPA creates the offline policy container hierarchy for only that domain. If you do not specify the domain name, then GPA creates an offline policy container hierarchy for each domain in the GP Repository (optional).

/S: Repository_Server

Name of the Microsoft SQL Server where you have installed the GP Repository. The default value, period (.), indicates the local Microsoft SQL Server.

/DB: DatabaseName

Name of the GP Repository database. The default value of the GP Repository database name is GPO_REPOSITORY. If the database name is different, specify the correct database name (optional, if you specify the domain name).

/?

Command-line Help for the tool.

Sample Code

NQCreateOfflinePolicyContainerHierarchy /D:ABC.com /S:ABCSQLServer /DB:ABCDatabaseName

B.3.2 Create Category

Create a new category.

Syntax

New-GPRCategory [-FAGPRPath] <String> [-Name] <String>

Parameter

Value

FAGPRPath

The FAGPRPath of the new category.

Name

The name of the new category.

Sample Code 1

The following sample creates a child category named “NewCategory” under the parent category “Desktop”.

NOTE:Before executing this cmdlet, run Set-GPRConnection to establish a connection to the GPA Repository database. See the PowerShell cmdlet sample for more information.

PS C:\>New-GPRCategory  -FAGPRPath "FAGPR://CN=Desktop,DC=NetIQLabs,DC=com" -Name "NewCategory"

Sample Code 2

The following sample creates a Domain-level category named “NewCategory” on the domain “NetIQLabs.com”.

NOTE:Before executing this cmdlet, run Set-GPRConnection to establish a connection to the GPA Repository database. See the PowerShell cmdlet sample for more information.

PS C:\>New-GPRCategory  -FAGPRPath "FAGPR://DC=NetIQLabs,DC=com" -Name "NewCategory"

B.3.3 Set Default User Map

Updates the target domain map for the source domain (the map to target domain from source domain). For each user in the source domain's map, this operation adds a map entry from the source account to the target account with the same account name (if any).

Syntax

Set-GPRDefaultUserMap [-SourceDomain] <String> [-TargetDomain] <String>

Parameter

Value

SourceDomain

The FAGPR path of the source domain.

TargetDomain

The FAGPR path of the target domain.

Sample Code

The following sample maps each user account from the source domain, Org1.com, to the corresponding target account with the same name in Test.Org1.com.

PS C:\>Set-DefaultUserMap -SourceDomain "FAGPR://DC=Org1,DC=com" -TargetDomain "FAGPR://DC=Test,DC=Org1,DC=com"

B.3.4 Merge GPOs

Merges the settings from two GPOs into a new GPO in the same domain.

Syntax

Merge-GPRGpo [-SourceFAGPRPath] <String[]> [-TargetFAGPRPath] <String> [[-TargetGPOName] <String>] [[DeleteAllSource] <SwitchParameter>]

Parameter

Value

SourceFAGPRPath

The FAGPR paths of the source GPOs.

TargetFAGPRPath

The target category path where the new merged GPO will be created.

TargetGPOName

The name of the new GPO.

DeleteAllSource (optional)

Indicates whether to delete the source GPOs after the merge. You don't have to specify a value with this parameter.

Sample Code 1

NOTE:Before executing this cmdlet, run Set-GPRConnection to establish a connection to the GPA Repository database. See the PowerShell cmdlet sample for more information.

The following sample merges two GPOs and creates a new GPO in the specified category.

PS C:\>Merge-GPRGpo -SourceFAGPRPath ("FAGPR://CN={6BE2D70A-46B5-4287-A88F-8C31C2E73586}, CN=cat, DC=gpdom150,DC=lab","FAGPR://CN={8674177A-6A00-4F89-8CDD-1C075E137572}, CN=cat, DC=gpdom150,DC=lab") -TargetFAGPRPath "FAGPR://CN=cat, DC=gpdom150,DC=lab" -TargetGPOName "MergedGPO1"

Sample Code 2

NOTE:Before executing this cmdlet, run Set-GPRConnection to establish a connection to the GPA Repository database. See the PowerShell cmdlet sample for more information.

The following sample merges two GPOs and creates a new GPO in the specified category. The example also deletes the source GPOs.

PS C:\>Merge-GPRGpo -SourceFAGPRPath ("FAGPR://CN={6BE2D70A-46B5-4287-A88F-8C31C2E73586}, CN=cat,DC=gpdom150,DC=lab","FAGPR://CN={8674177A-6A00-4F89-8CDD-1C075E137572}, CN=cat, DC=gpdom150,DC=lab") -TargetFAGPRPath "FAGPR://CN=cat, DC=gpdom150,DC=lab" -TargetGPOName "MergedGPO1" -DeleteAllSource

Sample Code 3

NOTE:Before executing this cmdlet, run Set-GPRConnection to establish a connection to the GPA Repository database. See the PowerShell cmdlet sample for more information.

The following sample merges two GPOs and creates a new GPO, overwriting one of the source GPOs.

PS C:\>Merge-GPRGpo -SourceFAGPRPath ("FAGPR://CN={6BE2D70A-46B5-4287-A88F-8C31C2E73586}, CN=cat,DC=gpdom150,DC=lab","FAGPR://CN={8674177A-6A00-4F89-8CDD-1C075E137572}, CN=cat, DC=gpdom150,DC=lab") -TargetFAGPRPath "FAGPR://CN={6BE2D70A-46B5-4287-A88F-8C31C2E73586}, CN=cat, DC=gpdom150,DC=lab"