Remove-SPOUser

Removes a user or a security group from a site collection or a group.

Syntax

Remove-SPOUser
      [-Group <String>]
      -LoginName <String>
      -Site <SpoSitePipeBind>
      [<CommonParameters>]

Description

You must be a SharePoint Online global administrator and a site collection administrator to run the Remove-SPOUser cmdlet.

For permissions and the most current information about Windows PowerShell for SharePoint Online, see the online documentation at https://go.microsoft.com/fwlink/p/?LinkId=251832 (https://go.microsoft.com/fwlink/p/?LinkId=251832).

Examples

-----------------------EXAMPLE-----------------------------

Remove-SPOUser -Site https://contoso.sharepoint.com/sites/sc1 -LoginName joe.healy@contoso.com -Group "SC1 Owners"

This example removes a user who has the email address joe.healy@contoso.com from the group SC1 Owners in the site collection https://contoso.sharepoint.com/sites/sc1.

Parameters

-Group

Specifies the group to remove the user from. If not specified, the cmdlet removes the user from all groups.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Online
-LoginName

Specifies the user name.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Online
-Site

Specifies the site collection to remove the user from.

Type:SpoSitePipeBind
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Online