Share via


AddUser(Microsoft.SharePoint.SPUser) Method

The AddUser method of the SPGroup class adds the specified user to the cross-site group.

Parameters

user   An SPUser object that represents the user.

Example

The following code example adds all the users of a subsite to a cross-site group in the site collection.

This example requires using directives (Imports in Visual Basic) for both the Microsoft.SharePoint and Microsoft.SharePoint.WebControls namespaces.

Requirements

Platforms: Microsoft Windows Server 2003

Security: Code Access Security