Adds a partial profile for the specified user to the zone.


IHierarchicalUser AddUserPartialProfile(DirectoryEntry userDE)
IHierarchicalUser AddUserPartialProfile(SearchResult userSR)
IHierarchicalUser AddUserPartialProfile(string userDn)
IHierarchicalUser AddUserPartialProfile(IAdsUser userIAds)


Specify one of the following parameters when using this method.

Parameter Description


The directory entry for the user for which you want a partial profile.


The directory entry for a user specified as a search result.


The user specified as a distinguished name.


The IADs interface to the user.

Return value

The hierarchical user object that represents the user profile.


This method creates a new user profile with values set for the Cims and User properties. If the zone is an SFU zone, then this method also sets a value for the NISDomain property. You can then add other properties to the profile.

The profile is not stored in Active Directory until you call the Commitmethod.


If you pass a null parameter, AddUserPartialProfile throws the exception ArgumentNullException.


The following code sample illustrates using the AddUserPartialProfile method in a script:

// Create a CIMS object to interact with AD
ICims cims = new Cims();
// Note the lack of the cims.connect function.
// By default, this application will use the connection to the domain controller
// and existing credentials from the computer already logged in.
// Get the zone object
IHierarchicalZone objZone =
cims.GetZoneByPath("cn=" + strZone + "," + strContainerDN) as IHierarchicalZone;
if (objZone == null)
    Console.WriteLine("Zone " + strZone + " does not exist.");
IUser objUser = cims.GetUserByPath(strUser);
if (objUser == null)
    Console.WriteLine("User " + strUser + " does not exist.");
IHierarchicalUser objUserUnixProfile = (IHierarchicalUser) 
if (objUserUnixProfile == null)
    //New user for the zone
    objUserUnixProfile = objZone.AddUserPartialProfile(strUser);
IRole objRole = objZone.GetRole(strRole);
if (objRole == null)
    Console.WriteLine("Role " + strRole + " does not exist.");
IRoleAssignment asg = objUserUnixProfile.GetUserRoleAssignment(objRole);
if (asg != null)
    Console.WriteLine("Assignment already exist.");
    // assigning role to user
    asg = objUserUnixProfile.AddUserRoleAssignment();
    asg.Role = objZone.GetRole(strRole);