Attach

Attaches the Centrify.DirectControl.NisMap.API namespace storage object to the specified zone.

Syntax

void Attach(string zonePath, string username, string password)

void Attach(DirectoryEntry zoneEntry)

Parameters

Specify the following parameters when using this method.

Parameter Description
zonePath The LDAP path to the zone to which you want to attach the NIS map storage object.
username The user name to use when linking the NIS map storage object to the specified zone.
password The user password to use when linking the NIS map storage object to the specified zone.
zoneEntry The directory entry for the zone to which you want to attach the NIS map storage object. (.NET only)

Exceptions

Attach may throw the following exception:

  • COMException if an error occurs in a call to the underlying interface.

  • ApplicationException if it fails to locate the NIS map store, the domain controller is read-only, access is not authorized, or an LDAP error occurs.LDAP errors can occur if the connection to the LDAP server fails, theconnection times out, invalid credentials are presented, or there are other problems communicating with Active Directory.

Example

The following code sample illustrates using Attach to create a map storage object and attach it to a zone:

...
'Identify the zone in which the NIS maps will be created
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 (username and 'password).
store.Attach zone.ADsPath, "jae.smith", "pas$w0rd"
'Use store.Create to add a generic NIS map in this zone.
store.Create "generic map","Generic Map"
'Use store.Create to also add two auto_master NIS maps
store.Create "auto.master","AutoMaster Map"
store.Create "auto_master","AutoMaster Map"
'Use store.Create to add a automount NIS map
store.Create "auto.mount","Automount Map"
'Use store.Create to add a netgroup NIS map
store.Create "netgroup","Netgroup Map"
wScript.Echo "NIS Maps added to " & zone.Name
...