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

  • failOnMissingMapEntry
    Type: System.Boolean

    true to fail if a map entry does not exist for a security principal or a UNC path; otherwise, false.

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