external help file | applicable | schema |
---|---|---|
SharePoint Server 2013, SharePoint Server 2016, SharePoint Online |
2.0.0 |
Removes one or more users as site collection administrators from the site collection in the current context
Remove-PnPSiteCollectionAdmin -Owners <List`1>
[-Connection <SPOnlineConnection>]
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.
PS:> Remove-PnPSiteCollectionAdmin -Owners "[email protected]"
This will remove [email protected] as a site collection owner from the site collection in the current context
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
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
PS:> Get-PnPSiteCollectionAdmin | Remove-PnPSiteCollectionAdmin
This will remove all existing site collection administrators from the site collection in the current context
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
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