RegistryPolicy.WriteListOfValues Method (RegistryHive, String, String, String[], RegistryValueKind, Boolean)


Writes a list of registry-based policy settings that configure String or ExpandString registry values. The registry values are specified by a value prefix and an array of value data; additive can be optionally specified.

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


public void WriteListOfValues(
    RegistryHive hive,
    string keyPath,
    string valuePrefix,
    string[] values,
    RegistryValueKind type,
    bool additive
void WriteListOfValues(
    RegistryHive hive,
    String^ keyPath,
    String^ valuePrefix,
    array<String^>^ values,
    RegistryValueKind type,
    bool additive
member WriteListOfValues : 
        hive:RegistryHive *
        keyPath:string *
        valuePrefix:string *
        values:string[] *
        type:RegistryValueKind *
        additive:bool -> unit
Public Sub WriteListOfValues (
    hive As RegistryHive,
    keyPath As String,
    valuePrefix As String,
    values As String(),
    type As RegistryValueKind,
    additive As Boolean


  • valuePrefix
    Type: System.String

    A string that specifies the value name prefix for the registry values. For example, if “MyValue” is specified, registry-based policy settings are created for the following value names: “MyValue1”, “MyValue2”, “MyValue3”, and so on depending on the length of the array that is specified for the values parameter.

  • values
    Type: System.String[]

    An array of strings that contains the value data.


Exception Condition

The RegistryPolicy is disposed.


The RegistryPolicy instance is read-only.


keyPath is null


values is null


keyPath is an empty string (“”)


values is an empty string (“”)


hive is not CurrentUser or LocalMachine


type is not ExpandString or String

See Also

WriteListOfValues Overload
RegistryPolicy Class
Microsoft.GroupPolicy Namespace

Return to top