AddMitUser

Adds a UNIX profile for a user in a trusted Kerberos realm to the zone.

Syntax

IUserUnixProfile AddMitUser(string fullMitUserName, int uid, string name, string shell, string homeDir, int primaryGroup)
IUserUnixProfile AddMitUser(string fullMitUserName, long uid, string name, string shell, string homeDir, long primaryGroup)

Parameters

Specify the following parameters when using this method.

Parameter Description

fullMitUserName

The full user name of the user and the trusted Kerberos realm. For example:

username@mit.realm.name

uid

The value to use as the UID of the user in the specified zone.

name

The UNIX profile name of the user in the specified zone.

shell

The default shell for the user in the specified zone.

homeDir

The default login shell for the user in the specified zone.

primaryGroup

The value to use as the GID for the user’s primary group.

Return value

A new UserUnixProfile object.

Discussion

This method creates a UNIX profile object for a user in a trusted realm that is not tied to an Active Directory user object.

There are two versions of this method: one designed for COM-based programs that supports a 32-bit signed number for the uid and primaryGroup arguments and one designed for .NET-based programs that allows a 64-bit signed number for the arguments.

Exceptions

AddMitUser may throw one of the following exceptions:

  • ApplicationException if you try to add a Kerberos user to an SFU zone.
  • NotSupportedException if the computer zone schema is not supported.

Example

The following code sample illustrates using AddMitUser in a script:

...
'Specify the zone you want to work with
set objZone = cims.GetZoneByPath("LDAP://CN=cohesion_div, CN=zones,CN=centrify,CN=program data,DC=arcade,DC=com")
'Create the UNIX profile for the Kerberos user “lewis.cain”
set objUserUnixProfile = objUser.AddMitUser(“lewis.cain@cohesion.org”,98566,”cainl”, “/bin/csh”, “home/cainl”, 98556)
'Enable the UNIX profile for the new user and update AD
objUserUnixProfile.UnixEnabled = True
objUserUnixProfile.commit
...