UserGroup.RemoveUserFromSite Method

Removes the specified user from the current site collection.

Namespace:  [UserGroup Web service]
Web service reference: http://Site/_vti_bin/UserGroup.asmx

Syntax

'Declaration
<SoapDocumentMethodAttribute("http://schemas.microsoft.com/sharepoint/soap/directory/RemoveUserFromSite", RequestNamespace := "http://schemas.microsoft.com/sharepoint/soap/directory/",  _
    ResponseNamespace := "http://schemas.microsoft.com/sharepoint/soap/directory/",  _
    Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Sub RemoveUserFromSite ( _
    userLoginName As String _
)
'Usage
Dim instance As UserGroup
Dim userLoginName As String

instance.RemoveUserFromSite(userLoginName)
[SoapDocumentMethodAttribute("http://schemas.microsoft.com/sharepoint/soap/directory/RemoveUserFromSite", RequestNamespace = "http://schemas.microsoft.com/sharepoint/soap/directory/", 
    ResponseNamespace = "http://schemas.microsoft.com/sharepoint/soap/directory/", 
    Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public void RemoveUserFromSite(
    string userLoginName
)

Parameters

  • userLoginName
    Type: System.String

    A string that contains the user name (DOMAIN\User_Alias) of the user.

Examples

The following code example removes a specified user from the current site collection.

Dim usrgrpService As New Web_Reference_Folder_Name.UserGroup()
usrgrpService.Credentials = System.Net.CredentialCache.DefaultCredentials

usrgrpService.RemoveUserFromSite("DOMAIN\User_Alias")
Web_Reference_Folder_Name.UserGroup usrgrpService = new Web_Reference_Folder_Name.UserGroup();
usrgrpService.Credentials= System.Net.CredentialCache.DefaultCredentials;

usrgrpService.RemoveUserFromSite("DOMAIN\\User_Alias");

See Also

Reference

UserGroup Class

UserGroup Members

UserGroup Web Service