Value

Gets or sets the value field associated with a specific NIS map entry key.

Syntax

string Value {get; set;}

Property value

The value field associated with a specific NIS map entry key.

Discussion

Each map entry consists of three primary fields: a key field, a value field, and an optional comment field. The content and format of the value field depends on the type of NIS map you are working with. For example, if you are setting the value field in a generic map, the field can contain virtually any string that you want served for a corresponding key name.

If you are setting the value field in a netgroup map, the field lists the members of the group, separated by a blank space. Each member can be either a group name or a triple of the form (hostname,username,domainname). For example:

set map = store.open("netgrouop")  
set entry = map.get("db_users")  
entry.Value = "fin hr (,dean,ajax.org) (clone\*,,)"

If you are defining the value field in an auto.mount map entry, the field consists of the mount options, a tab character, and the network path to the file to consult for the mount point being defined. For example:

set map = store.open("auto.mount")  
'Modify the value field of the “cdrom” mount point entry  
set entry = map.get("cdrom")  
entry.Value = "-fstype=nsfs,ro" & Chr(11) & ":/dev/sr0"

If you are defining the value field in an auto.master map entry, the field consists of the map file to consult, a tab character, and the mount options for the mount point being defined. For example:

set map = store.open("auto.mount")  
'Modify the value field of the “/net” mount point entry  
set entry = map.get("/net")  
entry.Value = "-hosts" & Chr(11) & "-nosuid,nobrowse"

Exceptions

Value throws an ArgumentException if you try to set a value that is null, empty, or greater than 1024 characters.

Example

The following code sample illustrates using Value to set the value associated with a specified NIS map entry in a netgroup map:

...  
'Identify the zone you want to work with  
set zone = cims.GetZone("sample.com/centrify/zones/default")  
'Create the Store object  
Set store = CreateObject("Centrify.DirectControl.Nis.Store")  
'Attach to the target zone.  
'Provide the path to the zone and user credentials  
store.Attach zone.ADsPath, "jae.smith", "pas\$w0rd"  
'Open the NIS map named “netgroup”  
set map = store.open("netgroup")  
'Modify the value field of the “db_admins” entry  
set entry = map.Get("db_admins")  
entry.Value = "dbas dbowners (,dean,) (firebird,jon,)"  
...