Gpo.Import Method (GpoBackup, GPMigrationTable, Boolean, GPStatusMessageCollection)
Imports the policy settings from a specified Group Policy object (GPO) backup by using the specified migration table and a value that specifies whether to fail if a map entry does not exist. This method also returns status.
Namespace: Microsoft.GroupPolicy
Assembly: Microsoft.GroupPolicy.Management (in Microsoft.GroupPolicy.Management.dll)
Syntax
public Gpo Import(
GpoBackup gpoBackup,
GPMigrationTable migrationTable,
bool failOnMissingMapEntry,
out GPStatusMessageCollection statusMessages
)
public:
Gpo^ Import(
GpoBackup^ gpoBackup,
GPMigrationTable^ migrationTable,
bool failOnMissingMapEntry,
[OutAttribute] GPStatusMessageCollection^% statusMessages
)
member Import :
gpoBackup:GpoBackup *
migrationTable:GPMigrationTable *
failOnMissingMapEntry:bool *
statusMessages:GPStatusMessageCollection byref -> Gpo
Public Function Import (
gpoBackup As GpoBackup,
migrationTable As GPMigrationTable,
failOnMissingMapEntry As Boolean,
<OutAttribute> ByRef statusMessages As GPStatusMessageCollection
) As Gpo
Parameters
gpoBackup
Type: Microsoft.GroupPolicy.GpoBackupA GpoBackup object that represents the backed-up GPO on the file system from which the settings should be imported.
migrationTable
Type: Microsoft.GroupPolicy.GPMigrationTableA GPMigrationTable object that holds the migration table.
failOnMissingMapEntry
Type: System.Booleantrue to fail if a map entry does not exist for a security principal or a UNC path; otherwise, false.
statusMessages
Type: Microsoft.GroupPolicy.GPStatusMessageCollectionWhen this method returns, contains a GPStatusMessageCollection that holds status for the operation.
Return Value
Type: Microsoft.GroupPolicy.Gpo
Returns Gpo. The GPO with the new settings imported.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | gpoBackup or migrationTable is null. |
Remarks
This method maps security principals and UNC paths using the information specified in the migration table, according to the value specified for failOnMissingMapEntry. Settings are mapped in the following manner:
If failOnMissingMapEntry is true and a setting cannot be mapped through the migration table, the method fails.
If failOnMissingMapEntry is false and a setting is found for which there is no map entry corresponding to a security principal or UNC path, the setting is imported without modification from the GPO backup. Security on the GPO and Software Installation Package objects is not copied.
See Also
Import Overload
Gpo Class
Microsoft.GroupPolicy Namespace
Return to top