GPDomain.ImportStarterGpo Method (String, Boolean, GPStatusMessageCollection)
Imports a Starter Group Policy object (GPO) into the domain from the specified Starter GPO cabinet (CAB) file and return status.
Namespace: Microsoft.GroupPolicy
Assembly: Microsoft.GroupPolicy.Management (in Microsoft.GroupPolicy.Management.dll)
Syntax
public StarterGpo ImportStarterGpo(
string filePath,
bool overwrite,
out GPStatusMessageCollection statusMessages
)
public:
StarterGpo^ ImportStarterGpo(
String^ filePath,
bool overwrite,
[OutAttribute] GPStatusMessageCollection^% statusMessages
)
member ImportStarterGpo :
filePath:string *
overwrite:bool *
statusMessages:GPStatusMessageCollection byref -> StarterGpo
Public Function ImportStarterGpo (
filePath As String,
overwrite As Boolean,
<OutAttribute> ByRef statusMessages As GPStatusMessageCollection
) As StarterGpo
Parameters
filePath
Type: System.StringThe path to the Starter GPO CAB file.
overwrite
Type: System.Booleantrue to overwrite any existing versions of the Starter GPO; otherwise, false.
statusMessages
Type: Microsoft.GroupPolicy.GPStatusMessageCollectionWhen this method returns, contains a GPStatusMessageCollection that holds status for the operation.
Return Value
Type: Microsoft.GroupPolicy.StarterGpo
Returns StarterGpo. The imported Starter GPO.
Exceptions
Exception | Condition |
---|---|
ArgumentException | filePath is an empty string (“”). |
ArgumentNullException | filePath is null. |
Remarks
When you import a Starter GPO from a CAB, the ID of the original Starter GPO that was used to create the CAB is retained. Therefore it is possible to have a version of the Starter GPO already existing in the domain when the ImportStarterGpo method is called. To ensure that no other Starter GPO exists with the same display name as the imported Starter GPO, specify true for the overwrite parameter.
See Also
ImportStarterGpo Overload
GPDomain Class
Microsoft.GroupPolicy Namespace
Return to top