NssVariables

Gets all the NSS environment variables.

Syntax

IDictionary\<string, string\> NssVariables {get;}

Property value

A dictionary of key-value pairs that define all the profile variables.

Discussion

The NSSVariables property is available only for .NET-based programs; call GetNSSVariables for VBScript.

Example

The following code sample illustrates using the NssVariables property in a script:

...  
IHierarchicalZone objParent =  
cims.GetZoneByPath("cn=" + strParentZone + "," + strContainerDN) as
IHierarchicalZone;  
if (objParent == null)  
{  
    Console.WriteLine("Parnet zone " + strParentZone + " does not exist.");  
}  
else  
{  
    IHierarchicalZone objZone = cims.CreateZone(objContainer, strZone) as IHierarchicalZone;
    // set the starting UID and GID for the zone
    objZone.NextUID = 10000;  
    objZone.NextGID = 10000;  
    objZone.UseNextUid = true;  
    objZone.UseNextGid = true;  
    objZone.AvailableShells = new string[] { "/bin/bash", "/bin/shell" };  
    objZone.DefaultShell = "%{shell}";  
    objZone.DefaultHomeDirectory = "%{home}/%{user}";  
    objZone.UserDefaultGecos = "%{u:description}";  
    objZone.Parent = objParent;  
    objZone.NssVariables.Add("shell", "/bin/bash" );  
    objZone.Commit();  
}  
...