UserCollection.Add Method
Adds the user specified by the user creation information parameter to the collection.
Namespace: Microsoft.SharePoint.Client
Assemblies: Microsoft.SharePoint.Client.Silverlight (in Microsoft.SharePoint.Client.Silverlight.dll); Microsoft.SharePoint.Client (in Microsoft.SharePoint.Client.dll)
Syntax
'Declaration
<RemoteAttribute> _
Public Function Add ( _
parameters As UserCreationInformation _
) As User
'Usage
Dim instance As UserCollection
Dim parameters As UserCreationInformation
Dim returnValue As User
returnValue = instance.Add(parameters)
[RemoteAttribute]
public User Add(
UserCreationInformation parameters
)
Parameters
parameters
Type: Microsoft.SharePoint.Client.UserCreationInformationA UserCreationInformation object that contains information associated with the user.
It must not be a null reference (Nothing in Visual Basic).
Return Value
Type: Microsoft.SharePoint.Client.User
A User object that represents the user to add.
Exceptions
Exception | Condition |
---|---|
SPException | The user does not exist or the user is not unique. Error code: -2130575276. The collection is read-only. Error code: -1. |
SecurityException | The collection is the farm administrators group and the specified user is not an administrator. Error code: -1. |
UnauthorizedAccessException | The current user does not have permissions to perform the action. Error code: -2147024891. |