A Sandcastle Documented Class Library

# IGroupService ModifyGroupMembershipForAccount Method

Modifies the list of groups to which an account belongs.

Namespace: Dundas.BI.AccountServices
Assembly: Dundas.BI.Core (in Dundas.BI.Core.dll) Version: 2.0.0.0 (10.0.0.1002)
Syntax
C#
VB
C++
F#
Copy

    void ModifyGroupMembershipForAccount(
    	Guid accountId,
    	ICollection<Guid> addToGroupIds,
    	ICollection<Guid> removeFromGroupIds
    )

    Sub ModifyGroupMembershipForAccount (
    	accountId As Guid,
    	addToGroupIds As ICollection(Of Guid),
    	removeFromGroupIds As ICollection(Of Guid)
    )

    void ModifyGroupMembershipForAccount(
    	Guid accountId,
    	ICollection<Guid>^ addToGroupIds,
    	ICollection<Guid>^ removeFromGroupIds
    )

    abstract ModifyGroupMembershipForAccount :
            accountId : Guid *
            addToGroupIds : ICollection<Guid> *
            removeFromGroupIds : ICollection<Guid> -> unit

#### Parameters

accountId
  Type: System
  Guid
  The ID of the account to be modified.
addToGroupIds
  Type: System.Collections.Generic
  ICollection
  Guid
  Group IDs which this account to be added to. It can be
  if no groups to add to.
removeFromGroupIds
  Type: System.Collections.Generic
  ICollection
  Guid
  Group IDs which this account to be removed from. It can be
  if no groups to remove from.

Exceptions

Exception | Condition
--- | ---
ArgumentException | accountId is Empty.
NotFoundException | The account with the specified ID does not exist. -or- addToGroupIds or removeFromGroupIds contains the ID of a group which does not exist.
InvalidOperationException | Attempt to modify the membership of a system-controlled group (see remarks). -or- Same group ID found in both addToGroupIds and removeFromGroupIds. -or- A tenant account is being added as a member of the System Administrators group.
NotSupportedException | The underlying groups provider does not allow modifications to groups.
NoPrivilegeException | The caller does not have system administration privileges. -or- The account is associated with a tenant, and the caller does not have administration privileges for that tenant. -or- The account is associated with a tenant, and an attempt has been made to make it a member of a group which is not associated with that tenant. -or- The caller does not have administration privileges for all the specified groups.
InvalidSessionException | The caller context is not associated with a valid session.

Remarks
This method will throw InvalidOperationException if an attempt is made to modify system-controlled groups. System-controlled groups include the Everyone group as well as any Tenant Members groups.
See Also

#### Reference

IGroupService Interface
Dundas.BI.AccountServices Namespace