RegistryPolicy.WriteExpandStringValue Method (RegistryHive, String, String, String)
Writes a Registry preference item that configures an ExpandString registry value.
Namespace: Microsoft.GroupPolicy
Assembly: Microsoft.GroupPolicy.Management (in Microsoft.GroupPolicy.Management.dll)
Syntax
public void WriteExpandStringValue(
RegistryHive hive,
string keyPath,
string valueName,
string value
)
public:
void WriteExpandStringValue(
RegistryHive hive,
String^ keyPath,
String^ valueName,
String^ value
)
member WriteExpandStringValue :
hive:RegistryHive *
keyPath:string *
valueName:string *
value:string -> unit
Public Sub WriteExpandStringValue (
hive As RegistryHive,
keyPath As String,
valueName As String,
value As String
)
Parameters
hive
Type: Microsoft.Win32.RegistryHiveOne of the RegistryHive values that specifies the registry hive of the key. Specify CurrentUser to write policy settings to User Configuration. Specify LocalMachine to write policy settings to Computer Configuration. No other values are supported.
keyPath
Type: System.StringThe path to the registry key.
valueName
Type: System.StringThe name of the registry value. You can specify an empty string (“”) for the default value.
value
Type: System.StringA string that contains the value data.
Exceptions
Exception | Condition |
---|---|
ObjectDisposedException | The RegistryPolicy is disposed. |
InvalidOperationException | The RegistryPolicy instance is read-only. |
ArgumentNullException | keyPath is null or value is null |
ArgumentException | keyPath is an empty string (“”) -or- hive is not CurrentUser or LocalMachine |
See Also
RegistryPolicy Class
Microsoft.GroupPolicy Namespace
Return to top