Skip to content

Latest commit

 

History

History
79 lines (57 loc) · 2.38 KB

Remove-PnPSiteCollectionAdmin.md

File metadata and controls

79 lines (57 loc) · 2.38 KB
external help file applicable schema
SharePoint Server 2013, SharePoint Server 2016, SharePoint Online
2.0.0

Remove-PnPSiteCollectionAdmin

SYNOPSIS

Removes one or more users as site collection administrators from the site collection in the current context

SYNTAX

Remove-PnPSiteCollectionAdmin -Owners <List`1>
                              [-Connection <SPOnlineConnection>]

DESCRIPTION

This command allows removing one to many users as site collection administrators from the site collection in the current context. All existing site collection administrators not included in this command will remain site collection administrator.

EXAMPLES

------------------EXAMPLE 1------------------

PS:> Remove-PnPSiteCollectionAdmin -Owners "[email protected]"

This will remove [email protected] as a site collection owner from the site collection in the current context

------------------EXAMPLE 2------------------

PS:> Remove-PnPSiteCollectionAdmin -Owners @("[email protected]", "[email protected]")

This will remove [email protected] and [email protected] as site collection owners from the site collection in the current context

------------------EXAMPLE 3------------------

PS:> Get-PnPUser | ? Title -Like "*Doe" | Remove-PnPSiteCollectionAdmin

This will remove all users with their title ending with "Doe" as site collection owners from the site collection in the current context

------------------EXAMPLE 4------------------

PS:> Get-PnPSiteCollectionAdmin | Remove-PnPSiteCollectionAdmin

This will remove all existing site collection administrators from the site collection in the current context

PARAMETERS

-Owners

Specifies owner(s) to remove as site collection adminstrators. Can be both users and groups.

Type: List`1
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

-Connection

Optional connection to be used by cmdlet. Retrieve the value for this parameter by eiter specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: SPOnlineConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

RELATED LINKS

SharePoint Developer Patterns and Practices