AddGroupPartialProfile

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

Syntax

IHierarchicalGroup AddGroupPartialProfile(DirectoryEntry groupDE)

IHierarchicalGroup AddGroupPartialProfile(SearchResult groupSR)

IHierarchicalGroup AddGroupPartialProfile(string groupDn)

IHierarchicalGroup AddGroupPartialProfile(IAdsGroup groupIAds)

Parameters

Specify one of the following parameters when using this method.

Parameter Description
groupDE The directory entry for the group for which you want a partial profile.
groupSr The directory entry for a group specified as a search result.
groupDn The group specified as a distinguished name.
groupIads The IADs interface to the group.

Return value

The hierarchical group object that represents the group profile.

Discussion

This method creates a new group profile with values set for the Cims and Group 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 Commit method.

The AddAccessGroup(DirectoryEntry groupDE) and AddAccessGroup(SearchResult groupSR) methods are available only for .NET-based programs; call User for VBScript.

Exceptions

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

Example

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

...  
// Get the zone object
IHierarchicalZone objZone = cims.GetZoneByPath("cn=" + strZone + "," +
strContainerDN) as  
IHierarchicalZone;  
// Load the unix profiles associated with the group
// Determine if the specified group is already a member of the zone.
// This method will either return a blank objGroupUnixProfile 
// or one containing data 
IGroupUnixProfile objGroupUnixProfile;  
if (objZone.GetGroupUnixProfileByName(strUnixGroup) == null)  
{  
    // Add this zone to the group  
    objGroupUnixProfile = objZone.AddGroupPartialProfile(strGroup);  
    objGroupUnixProfile.Name = strUnixGroup;  
    // Save 
    objGroupUnixProfile.Commit();  
}  
...