Share via


ICluster.SetEnvironmentVariable Method

Sets a cluster-wide environment variable.

Namespace: Microsoft.ComputeCluster
Assembly: CcpAPI (in ccpapi.dll)

Usage

Syntax

'Declaration
Sub SetEnvironmentVariable ( _
    name As String, _
    value As String _
)
void SetEnvironmentVariable (
    string name,
    string value
)
void SetEnvironmentVariable (
    String^ name, 
    String^ value
)
void SetEnvironmentVariable (
    String name, 
    String value
)
function SetEnvironmentVariable (
    name : String, 
    value : String
)

Parameters

  • name
    The name of the environment variable.
  • value
    The value of the environment variable. If NULL or an empty string, the variable is deleted.

Remarks

The sum of all environment variables is limited to 2,048 Unicode characters.

You can use this method to add, delete, or update an environment variable. However, you cannot delete or update the value of a CCP defined environment variables, such as CCP_CLUSTER_NAME. If you try to update the value of a CCP variable, you will get a duplicate entry.

To retrieve the cluster-wide environment variables, access the ICluster.EnvironmentVariables property.

To set task-specific environment variables, call the ITask.SetEnvironmentVariable method.

To retrieve the variable from within a task, call the System.Environment.GetEnvironmentVariable(System.String) method.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Microsoft Windows Compute Cluster Server 2003, Windows Server 2003, Windows XP

Target Platforms

Microsoft Windows Compute Cluster Server 2003, Windows Server 2003 with Compute Cluster Pack Client Utilities, Windows XP with Compute Cluster Pack Client Utilities

See Also

Reference

ICluster Interface
ICluster Members
Microsoft.ComputeCluster Namespace
EnvironmentVariables
ITask.SetEnvironmentVariable