RegistryPolicy.Write Method (PolicyRegistrySetting, Boolean)
Writes the registry-based policy setting that is specified by the PolicyRegistrySetting object.
Namespace: Microsoft.GroupPolicy
Assembly: Microsoft.GroupPolicy.Management (in Microsoft.GroupPolicy.Management.dll)
Syntax
public void Write(
PolicyRegistrySetting registrySetting,
bool additive
)
public:
void Write(
PolicyRegistrySetting^ registrySetting,
bool additive
)
member Write :
registrySetting:PolicyRegistrySetting *
additive:bool -> unit
Public Sub Write (
registrySetting As PolicyRegistrySetting,
additive As Boolean
)
Parameters
registrySetting
Type: Microsoft.GroupPolicy.PolicyRegistrySettingA PolicyRegistrySetting that represents the registry-based policy setting.
additive
Type: System.Booleantrue for additive; otherwise false.
Exceptions
Exception | Condition |
---|---|
ObjectDisposedException | The RegistryPolicy is disposed. |
InvalidOperationException | The RegistryPolicy instance is read-only. |
ArgumentNullException | registrySetting is null |
ArgumentException | Hive member property of registrySetting is not CurrentUser or LocalMachine. |
See Also
RegistryPolicy Class
Microsoft.GroupPolicy Namespace
Return to top