B.5 GPO Node Operations

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

B.5.1 Approve GPO

Approve a GPO to be exported to Active Directory or unapprove a GPO. If you set the value of the parameter to True, the method approves the GPO. Else, if the value of the parameter is False, the method unapproves the GPO.

Syntax

Set-GPRApproveGpo [-FAGPRPath] <String> [-Approve] <Boolean>

Parameter

Value

FAGPRPath

The FAGPRPath of the Repository object.

Approve

Specifies whether or not the GPO can be exported.

Sample Code

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 approves a repository GPO to be exported to AD from NetIQLabs.LAB.

PS C:\>Set-GPRApproveGpo -FAGPRPath "FAGPR://CN={36553F1C-6D5D-48E0-A471-F42EB87E25C2}, CN=Meger Scripts, DC=NetIQLabs,DC=LAB" -Approve $true

B.5.2 Approve GPO with Comments

Approve a GPO to be exported to Active Directory, or unapprove a GPO, and include comments in the history view. If you set the value of the parameter to True, the method approves the GPO. Else, if the value of the parameter is False, the method unapproves the GPO.

Syntax

Set-GPRApproveGpo [-FAGPRPath] <String> [-Approve] <Boolean> [-Comment] <String>

Parameter

Value

FAGPRPath

The FAGPRPath of the Repository object.

Approve

Specifies whether or not the GPO can be exported.

Comment

Allows you to make a statement regarding the approval of the GPO.

Sample Code

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 approves a repository GPO to be exported to AD from NetIQLabs.LAB and adds a comment.

PS C:\>Set-GPRApproveGpo -FAGPRPath "FAGPR://CN={36553F1C-6D5D-48E0-A471-F42EB87E25C2}, CN=Meger Scripts, DC=NetIQLabs,DC=LAB" -Approve $true -Comment "Approved by PowerShell script"

B.5.3 Check In GPO

Check in a GPO.

Syntax

Close-GPRCheckInGpo [-FAGPRPath] <String> [-Comment] <String>

Parameter

Value

FAGPRPath

The FAGPRPath of the Repository object.

Comment

Allows you to make a statement regarding the check-in porcess.

Sample Code

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 checks in a repository GPO from GPDOM.LAB and adds an optional comment.

PS C:\>CheckInGpo -FAGPRPath "FAGPR://CN={36553F1C-6D5D-48E0-A471-F42EB87E25C2}, CN=Meger Scripts, DC=GPDOM,DC=LAB" -Comment "Mycomment"

B.5.4 Check Out GPO

Check out a GPO.

Syntax

Open-GPRCheckOutGpo [-FAGPRPath] <String> [-Comment] <String>

Parameter

Value

FAGPRPath

The FAGPRPath of the Repository object.

Comment

Allows you to make a statement regarding the check-out porcess.

Sample Code

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 checks out a repository GPO from GPDOM.LAB and adds an optional comment.

PS C:\>Open-GPRCheckOutGpo -FAGPRPath "FAGPR://CN={36553F1C-6D5D-48E0-A471-F42EB87E25C2}, CN=Meger Scripts, DC=GPDOM,DC=LAB" -Comment "Mycomment"

B.5.5 Create a GPO Link to a SOM Object

Links the GPO to a Scope of Management (SOM) object.

Syntax

Set-GPRGpoLink [-FAGPRPath] <String> [-SomLdapPath] <String>

Parameter

Value

FAGPRPath

The FAGPRPath of the Repository object.

SomLdapPath

The LDAP path of the SOM object from AD.

Sample Code

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 links the GPO to an SOM object named “TestOU”.

PS C:\>Set-GPRGpoLink -FAGPRPath "FAGPR://CN={8BBF2488-6BED-410A-8B9B-174B0D6F63AA}, CN=TEST, DC=NetIQLabs,DC=com" -SomLdapPath "LDAP://OU=TestOU,DC=NetIQLabs,DC=lab"

B.5.6 Delete a GPO Link from a SOM Object

Deletes a GPO link from a Scope of Management (SOM) object.

Syntax

Remove-GPRGpoLink [-FAGPRPath] <String> [-SomLdapPath] <String>

Parameter

Value

FAGPRPath

The FAGPRPath of the Repository object.

SomLdapPath

The LDAP path of the SOM object from AD.

Sample Code

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 deletes a link from a GPO to an SOM object named “TestOU”.

PS C:\>Remove-GPRGpoLink -FAGPRPath "FAGPR://CN={8BBF2488-6BED-410A-8B9B-174B0D6F63AA}, CN=TEST, DC=NetIQLabs,DC=com" -SomLdapPath DAP://OU=TestOU,DC=NetIQLabs,DC=lab"

B.5.7 Delete GPO

Delete a GPO.

Syntax

Remove-GPRGpo [-FAGPRPath] <String>

Parameter

Value

FAGPRPath

The FAGPRPath of the Repository object.

Sample Code

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 deletes a repository GPO from GPDOM.LAB.

PS C:\>Remove-GPRGpo -FAGPRPath "FAGPR://CN={36553F1C-6D5D-48E0-A471-F42EB87E25C2}, CN=Meger Scripts, DC=GPDOM,DC=LAB"

B.5.8 Export GPO

Export approved GPO to live Active Directory domain.

Export Parameter

You can specify one of the following export parameters:

BackUpOverwrite

If the GPO already exists in Active Directory, overwrite it and back up the live Active Directory GPO into the GP Repository prior to overwriting it. You can also use an integer value of 14 instead of BackUpOverwrite.

NoBackUpOverwrite

If the GPO already exists in Active Directory, overwrite it. The live GPO is not backed up prior to import. You can also use an integer value of 13 instead of NoBackUpOverwrite.

DoNotOverwrite

Export fails if the GPO already exists in Active Directory. You can also use an integer value of 12 instead of DoNotOverwrite.

Syntax

Export-GPRGpo [-FAGPRPath] <String> [-Overwrite] <SwitchParameter>

Parameter

Value

FAGPRPath

The FAGPRPath of the Repository object.

Overwrite

If the GPO already exists in the AD, it will be overwritten. You don't have to specify a value with this parameter.

Sample Code

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 exports a repository GPO to an Active Directory domain named “GPDOM.LAB”.

PS C:\>Export-GPRGpo -FAGPRPath "FAGPR://CN={36553F1C-6D5D-48E0-A471-F42EB87E25C2}, CN=Meger Scripts, DC=GPDOM,DC=LAB" -Overwrite

B.5.9 Export GPO with Comments

Export approved GPO to live Active Directory domain and include comments in the history view.

NOTE:This script can take several seconds or longer to complete when you run it for the first time.

Export Parameter

You can specify one of the following export parameters:

BackUpOverwrite

If the GPO already exists in Active Directory, Overwrite it and backup the live Active Directory GPO into the GP Repository prior to overwriting it. You can also use an integer value of 14 instead of BackUpOverwrite.

NoBackUpOverwrite

If the GPO already exists in the Active Directory overwrite it. The live GPO is not backed up prior to Import. You can also use an integer value of 13 instead of NoBackUpOverwrite.

DoNotOverwrite

Export fails if the GPO already exists in Active Directory. You can also use an integer value of 12 instead of DoNotOverwrite.

Syntax

Export-GPRGpo [-FAGPRPath] <String> [-Overwrite] <SwitchParameter> [-Comment] <String>

Parameter

Value

FAGPRPath

The FAGPRPath of the Repository object.

Overwrite

If the GPO already exists in the AD, it will be overwritten. You don't have to specify a value with this parameter.

Comment

You can make a statement regarding the export process.

Sample Code

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 exports a repository GPO to an Active Directory domain named “GPDOM.LAB” and adds a comment.

PS C:\>Export-GPRGpo -FAGPRPath "FAGPR://CN={36553F1C-6D5D-48E0-A471-F42EB87E25C2}, CN=Meger Scripts, DC=GPDOM,DC=LAB" -Comment "This GPO has been exported to Active Directory." -Overwrite

The Export Batch File

This batch file uses the GPAExportUtil.exe tool to create an entry for each approved GPO you have selected to export. If you want to export all approved GPOs in the selected domains, the batch file uses the GPAExportUtil.exe tool to create an entry for each selected domain.

Syntax

"<product installation path>\GPAExportUtil.exe" {{/g:<guid of GPO> |

/d:<DNS name of AD domain> | /a}

{/C:"<SQL Connection string>" | {/SQLS:<repository_server>

/SQLD:<rep_database_name> [/U:<SQL username> /P:<SQL password>]}} |

[/?|/H]

Options

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

Variable name

Replace with

/g:<guid of GPO>

The GUID of the approved GPO you want to export using GPAExportUtil.exe. Use along with the /d option when you want to export two or more GPOs with the same GUID, but from different domains (required when exporting individual GPOs)

/d:<DNS name of AD domain>

The DNS name of the domain where approved GPOs will be exported. When this parameter is not specified, approved GPOs will be exported to the domain of the user performing the export. You can use this parameter when exporting any built‑in domain policy GPOs or GPOs with same GUID.

/a

All approved GPOs in all domains of the specified GP Repository will be exported (optional).

/C:"<SQL Connection string>"

Full SQL Server connection string to the GP Repository database, in double quotes. Use instead of the other SQL Server parameters (required).

/SQLS:<repository_server>

Name of the GP Repository SQL Server (optional).

/SQLD:<rep_database_name>

Name of the GP Repository SQL Server database (optional).

/U:<SQL username>

SQL Server account name to use for SQL Authentication (optional).

/P:<SQL password>

SQL Server account password to use for SQL Server Authentication. Use caution when specifying this parameter in batch files (optional).

Sample Code

To export two selected GPOs from the domain, the export batch file contains the following entries:

"C:\Program Files\NetIQ\Group Policy Administrator\tools\GPAExportUtil.exe" /g:{1FEB5933-DA75-49BC-A63F-FA86C7CA9E20} /d:usregion.com /Connect:"Provider=SQLOLEDB.1;Integrated Security=SSPI;Initial Catalog=GPO_REPOSITORY;Data Source=TREK02;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=TREK02;Use Encryption for Data=False;Tag with column collation when possible=False"

"C:\Program Files\NetIQ\Group Policy Administrator\tools\GPAExportUtil.exe" /g:{F94F2CF6-0264-4DA6-B76C-7C920360894D} /d:usregion.com /Connect:"Provider=SQLOLEDB.1;Integrated Security=SSPI;Initial Catalog=GPO_REPOSITORY;Data Source=TREK02;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=TREK02;Use Encryption for Data=False;Tag with column collation when possible=False"

To export all GPOs in a domain, the export batch file contains the following entry:

"C:\Program Files\NetIQ\Group Policy Administrator\tools\GPAExportUtil.exe" /d:usregion.com /Connect:"Provider=SQLOLEDB.1;Integrated Security=SSPI;Initial Catalog=GPO_REPOSITORY;Data Source=TREK02;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=TREK02;Use Encryption for Data=False;Tag with column collation when possible=False"

To export two GPOs (in this case, the default domain policy) with the same GUID, but from different domains, the export batch file contains the following entries:

"C:\Program Files\NetIQ\Group Policy Administrator\tools\GPAExportUtil.exe" /g:{31B2F340-016D-11D2-945F-00C04FB984F9} /d:usregion.com /Connect:"Provider=SQLOLEDB.1;Integrated Security=SSPI;Initial Catalog=GPO_REPOSITORY;Data Source=TREK02;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=TREK02;Use Encryption for Data=False;Tag with column collation when possible=False"

"C:\Program Files\NetIQ\Group Policy Administrator\tools\GPAExportUtil.exe" /g:{31B2F340-016D-11D2-945F-00C04FB984F9} /d:nordicregion.com /Connect:"Provider=SQLOLEDB.1;Integrated Security=SSPI;Initial Catalog=GPO_REPOSITORY;Data Source=TREK02;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=TREK02;Use Encryption for Data=False;Tag with column collation when possible=False"

B.5.10 Get GPO Check Out Status

Allows you to view whether a GPO is checked out. This operation returns a True or False value. True indicates a GPO is checked out and False indicates that the GPO is checked in.

Syntax

Get-GPRCheckOutStatus [-FAGPRPath] <String>

Parameter

Value

FAGPRPath

The FAGPRPath of the Repository object.

Sample Code

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 checks the check out status of a repository GPO from GPDOM.LAB.

PS C:\>CheckOutStatus -FAGPRPath "FAGPR://CN={36553F1C-6D5D-48E0-A471-F42EB87E25C2}, CN=Meger Scripts, DC=GPDOM,DC=LAB"

B.5.11 Get GPO Approval Status

Allows you to read the approval status of a GPO. This operation returns a True or False value. A True value denotes Approved status and a False value denotes Unapproved status.

Syntax

Get-GPRGpoApproveStatus [-FAGPRPath] <String>

Parameter

Value

FAGPRPath

The FAGPRPath of the Repository object.

Sample Code

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 checks the approval status of a repository GPO from GPDOM.LAB.

PS C:\>Get-GPRGpoApproveStatus -FAGPRPath "FAGPR://CN={36553F1C-6D5D-48E0-A471-F42EB87E25C2}, CN=Meger Scripts, DC=GPDOM,DC=LAB"

B.5.12 Lock or Mask GPO

Sets or gets status of locking or masking of a GPO for a user or group.

Syntax

Get-GPRGpoSecurityFilter [-FAGPRPath] <String> [-AccountName] <String> [-OpType] <String>
Set-GPRGpoSecurityFilter [-FAGPRPath] <String> [-AccountName] <String> [-OpType] <String> [-Force] <SwitchParameter>

Parameter

Value

FAGPRPath

The FAGPRPath of the Repository object.

AccountName

User or Group

OpType

  • Lock
  • Mask
  • Unlock
  • Unmask

Force (optional)

Allows or prevents the deletion of the security filter options.

Sample Code

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 locks a GPO for a user object.

PS C:\>Set-GPRGpoSecurityFilter -FAGPRPath "FAGPR://CN={8BBF2488-6BED-410A-8B9B-174B0D6F63AA}, CN=TEST, DC=NetIQLabs,DC=com" -AccountName "MYDOMAIN\MyUser" -OpType "Lock"

The following sample checks if the GPO is masked for the user 'MyUser' from the domain 'MYDOMAIN' and returns the result.

PS C:\>Get-GPRGpoSecurityFilter -FAGPRPath "FAGPR://CN={8BBF2488-6BED-410A-8B9B-174B0D6F63AA}, CN=TEST, DC=NetIQLabs,DC=com" -AccountName "MYDOMAIN\MyUser" -OpType "Mask"

B.5.13 Generate GPO Report

Generate an HTML report for a specific version of a GPO. Specify the version number of the GPO that you want to generate a report for. If you want to generate a Report for the latest version of the GPO then pass the value as 0.

Syntax

Get-GPRGpoSettingsReport [-FAGPRPath] <String> [-Version] <Int32> [-HtmlFileName] <String>

Parameter

Value

FAGPRPath

The FAGPRPath of the Repository object.

Version

Specifies the version number of the GPO for which you want to run a report.

HtmlFileName

  • Specifies the target location of the settings report.

Sample Code

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 generates a settings report for a repository GPO from NetIQLabs.com.

PS C:\>Get-GPRGpoSettingsReport -FAGPRPath "FAGPR://CN={8BBF2488-6BED-410A-8B9B-174B0D6F63AA}, CN=TEST, DC=NetIQLabs,DC=com" -Version 0 -HtmlFileName "c:\test.html"

B.5.14 Compare or Differentiate Two GPOs

Compare two GPOs and generate an HTML report of the comparison including the similarities and differences. The two GPOs must exist before running this operation. The DiffParameter indicates the type of comparison report. A True value includes only the differences in the report. A False value includes both the similarities and differences in the report.

Syntax

Compare-GPRGpoSettingsReport [-FAGPRPath] <String> [-GPOtoCompare] <String> [-HTMLFileName] <String>

Parameter

Value

FAGPRPath

The FAGPRPath of the first GPO in the comparison.

GPOtoCompare

Specifies the second GPO in the comparison.

HtmlFileName

  • Specifies the target location for the settings report.

DiffOnly (optional)

Specifies the type of comparison report. If you include this parameter, the report includes only the differences. Otherwise, the report includes both the similarities and differences.

Sample Code

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 compares two GPOs and stores the report at "C:\ComparisonReport.html".

PS C:\>Compare-GPRGpoSettingsReport -FAGPRPath "FAGPR://CN={36553F1C-6D5D-48E0-A471-F42EB87E25C2}, CN=Meger Scripts, DC=GPDOM,DC=LAB" -GPOToCompare "FAGPR://CN={8BBF2488-6BED-410A-8B9B-174B0D6F63AA}, CN=TEST, DC=GPDOM,DC=LAB" -HTMLFileName "C:\ComparisonReport.html"

B.5.15 Compare GPO GP Repository Versions

Generate a comparison HTML report with two different GP Repository versions of the GPO. The DiffParameter indicates the type of comparison report. A True value includes only the differences in the report. A False value includes both the similarities and differences in the report.

Syntax

Compare-GPRGpoSettingsReportVersion [-FAGPRPath] <String> [-RepVersion1] <Int32> [-RepVersion2] <Int32> [-HTMLFileName] <String>

Parameter

Value

FAGPRPath

The FAGPRPath of the Repository GPO.

RepVersion1

Specifies the first version of the GPO that you want to compare.

RepVersion2

Specifies the second version of the GPO that you want to compare.

HtmlFileName

  • Specifies the target location for the HTML report.

DiffOnly (optional)

Specifies the type of comparison report. If you include this parameter, the report includes only the differences. Otherwise, the report includes both the similarities and differences.

Sample Code

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 compares two versions of a repository GPO and stores the resulting report at "C:\ComparisonReport.html".

PS C:\>Compare-GPRGpoSettingsReportVersion -FAGPRPath "FAGPR://CN={36553F1C-6D5D-48E0-A471-F42EB87E25C2}, CN=Meger Scripts, DC=GPDOM,DC=LAB" -RepVersion1 1 -RepVersion2 2 -HtmlFileName "C:\ComparisonReport.html"

B.5.16 Compare and Differentiate Active Directory GPO Versions

Generate a comparison HTML report with GPOs from Active Directory. The DiffParameter indicates the type of comparison report. A True value includes only the differences in the report. A False value includes both the similarities and differences in the report.

Syntax

Compare-GPRGpoSettingsReportAD [-FAGPRPath] <String> [-RepVersion] <Int32> [-HTMLFileName] <String>

Parameter

Value

FAGPRPath

The FAGPRPath of the Repository GPO.

RepVersion

Specifies the version of the GPO that you want to compare.

HtmlFileName

  • Specifies the target location for the HTML report.

DiffOnly (optional)

Specifies the type of comparison report. If you include this parameter, the report includes only the differences. Otherwise, the report includes both the similarities and differences.

Sample Code

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 compares the repository version of a GPO with its Active Directory version and stores the resulting report at "C:\ComparisonReport.html".

PS C:\>Compare-GPRGpoSettingsReportAD -FAGPRPath "FAGPR://CN={36553F1C-6D5D-48E0-A471-F42EB87E25C2}, CN=Meger Scripts, DC=GPDOM,DC=LAB" -RepVersion 1 -HTMLFileName "C:\ComparisonReport.html"

B.5.17 Migrate GPO

Migrate a GPO across different domains or to a different category within the same domain. You can specify either a category or a GPO as the target. In either case, specify the GP Repository path of the target object.

Syntax for Migrating a New GPO

GPOObject.MigrateTo TargetCategory

Syntax for Migrating an Existing GPO

GPOObject.MigrateToEx TargetGPO, True|False

Syntax

Move-GPRMigrateGpo [-TargetFAGPRPath] <String> [-FAGPRPath] <String> [-RenameGpo] <SwitchParameter>

Parameter

Value

TargetFAGPRPath

The GPR path of the target category or the target GPO.

FAGPRPath

The FAGPRPath of the Repository GPO.

RenameGpo (optional)

Renames the target GPO. You don't have to specify a value with this parameter.

Sample Code, Scenario 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 moves a GPO to a different category.

PS C:\>Move-GPRMigrateGpo –TargetFAGPRPath "FAGPR://CN=CATTEST,DC=NetIQLabs,DC=COM" -FAGPRPath "FAGPR://CN={5EEBEF0F-5304-4FCC-83C7-835EFBB72CCC},CN=CATTEST,DC=NetIQLabs,DC=COM"

Sample Code, Scenario 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 moves a GPO to another GPO and renames the target GPO to match the source GPO.

PS C:\>Move-GPRMigrateGpo -TargetFAGPRPath "FAGPR://CN={7A1741A8-ECF7-42D8-9A02-C96B15F1FAF5},CN=CATTEST, DC=NetIQLabs,DC=Com" -FAGPRPath "FAGPR://CN={BFD3C60B-D2F9-49F9-A80E-5B1C17D5AD25},CN=CAT_TEST, DC=NetIQLabs,DC=com" -RenameGPO

B.5.18 Get-GPRGPOPath

The Get-GPRGPOPath cmdlet gets the GPOs for the specified Name or GUID. Before executing this cmdlet, use the Set-GPRConnection cmdlet to establish a connection to the GPA Repository database.

Gets the GPOs for the specified Name or GUID

PARAMETERS

Name <String>

The Name of the Repository GPO.

GUID <String>

The GUID of the Repository GPO

Domain [<String>]

The parameter is to specify the FAGPR path of the source domain.

<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information about_CommonParameters, see (http://go.microsoft.com/fwlink/?LinkID=113216).

SYNTAX

Get-GPRGPOPath [-Name] <String> [[-Domain] <String>] [<CommonParameters>]
Get-GPRGPOPath [-Guid] <String> [[-Domain] <String>] [<CommonParameters>]

NOTE:For examples, type "get-help Get-GPRGPOPath -examples". For more information, type "get-help Get-GPRGPOPath -detailed". For technical information, type "get-help Get-GPRGPOPath -full".

Example B-1 1

PS C:\>Get-GPRGPOPath -Name GPO1

This example gets all the GPOs with Name GPO1 in all the managed domains.

Example B-2 1

PS C:\>Get-GPRGPOPath -Guid "{7803F7D2-4B6C-4627-94E8-A1E0A4BAC97A}"

This example gets all the GPOs having GUID {7803F7D2-4B6C-4627-94E8-A1E0A4BAC97A}.

Example B-3 1

PS C:\>Get-GPRGPOPath -Name GPO1 -Domain NetIQLabs.COM

This example gets all the GPOs with Name GPO1 in the domain NetIQLabs.COM.

Example B-4 1

PS C:\>Get-GPRGPOPath -Guid "{7803F7D2-4B6C-4627-94E8-A1E0A4BAC97A}" -Domain NetIQLabs.COM

This example gets all the GPOs having GUID {7803F7D2-4B6C-4627-94E8-A1E0A4BAC97A} in the domain NetIQLabs.COM.

B.5.19 Read GPO Name

Retrieves the name of a GPO.

Syntax

Get-GPRGpo [-FAGPRPath] <String>

Parameter

Value

FAGPRPath

The FAGPRPath of the category.

Sample Code

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 displays the list of GPOs in the category name desktop in the domain NetIQLabs.com.

PS C:\>Get-GPRGpo -FAGPRPath "FAGPR://CN=Desktop,DC=NetIQLabs,DC=com"

B.5.20 Undo Check Out GPO

Undo a checkout without saving any changes to the GP Repository.

Syntax

Undo-GPRCheckOutGpo [-FAGPRPath] <String>

Parameter

Value

FAGPRPath

The FAGPRPath of the Repository object.

Sample Code

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 cancels the check out of a repository GPO from the GPDOM.LAB domain.

PS C:\>Undo-GPRCheckOutGpo -FAGPRPath "FAGPR://CN={36553F1C-6D5D-48E0-A471-F42EB87E25C2}, CN=Meger Scripts, DC=GPDOM,DC=LAB"