AddAccessGroup

Adds a group to the computer.

Syntax

IMzRoleAssignment AddAccessGroup(DirectoryEntry groupDE)

IMzRoleAssignment AddAccessGroup(SearchResult groupSR)

IMzRoleAssignment AddAccessGroup(string groupDn)

IMzRoleAssignment AddAccessGroup(IAdsGroup groupIAds)

Parameters

Specify one of the following parameters when using this method.

Parameter Description
groupDE The directory entry for the group you want to add.
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 computer role assignment that includes the specified group (IMzRoleAssignment.TrusteeType==Group).

Discussion

The role assignment 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 AddRoleAssignment for VBScript.

Exceptions

AddAccessGroup may throw one of the following exceptions:

  • ApplicationException if the specified parameter is not a group or the method cannot find the group.

  • ArgumentNullException if you pass a null parameter.