Gpo.Backup Method (String, String, GPStatusMessageCollection)

 

Backs up the Group Policy object (GPO) to the specified directory and returns status.

Namespace:   Microsoft.GroupPolicy
Assembly:  Microsoft.GroupPolicy.Management (in Microsoft.GroupPolicy.Management.dll)

Syntax

public GpoBackup Backup(
    string directory,
    string comment,
    out GPStatusMessageCollection statusMessages
)
public:
GpoBackup^ Backup(
    String^ directory,
    String^ comment,
    [OutAttribute] GPStatusMessageCollection^% statusMessages
)
member Backup : 
        directory:string *
        comment:string *
        statusMessages:GPStatusMessageCollection byref -> GpoBackup
Public Function Backup (
    directory As String,
    comment As String,
    <OutAttribute> ByRef statusMessages As GPStatusMessageCollection
) As GpoBackup

Parameters

  • directory
    Type: System.String

    The path to the backup directory.

  • comment
    Type: System.String

    A comment to include with the backed-up GPO. Specify null for no comment.

Return Value

Type: Microsoft.GroupPolicy.GpoBackup

Returns GpoBackup.

Exceptions

Exception Condition
ArgumentException

directory is an empty string.

ArgumentNullException

directory is null.

See Also

Backup Overload
Gpo Class
Microsoft.GroupPolicy Namespace

Return to top