GPDomain.CreateGpo Method (String)
Creates a new Group Policy object (GPO) with the specified display name in the domain.
Namespace: Microsoft.GroupPolicy
Assembly: Microsoft.GroupPolicy.Management (in Microsoft.GroupPolicy.Management.dll)
Syntax
public Gpo CreateGpo(
string gpoDisplayName
)
public:
Gpo^ CreateGpo(
String^ gpoDisplayName
)
member CreateGpo :
gpoDisplayName:string -> Gpo
Public Function CreateGpo (
gpoDisplayName As String
) As Gpo
Parameters
gpoDisplayName
Type: System.StringThe display name for the new GPO.
Return Value
Type: Microsoft.GroupPolicy.Gpo
Returns Gpo. The new GPO.
Exceptions
Exception | Condition |
---|---|
ArgumentException | gpoDisplayName is an empty string (“”). |
ArgumentNullException | gpoDisplayName is null. |
Remarks
Warning
It is possible to create more than one GPO with the same display name by using this method.
See Also
CreateGpo Overload
GPDomain Class
Microsoft.GroupPolicy Namespace
Return to top