How do I assign a SharePoint site collection admin using PnP PowerShell version 1.12?

I'm using PnP PowerShell version 1.12 and I need to assign a user as a site collection administrator on a SharePoint site. What is the correct cmdlet and syntax for this version? Are there any permission requirements I need to meet first?
 
You'd use the Set-PnPSiteCollectionAdmin cmdlet, just make sure you're connected to the site with Connect-PnPOnline first and that you have the necessary tenant admin permissions before running it.
 
Use PnP PowerShell v1.12: connect with Connect-PnPOnline, then run Set-PnPSiteCollectionAdmin with the user email. Ensure you have admin permissions before executing the command successfully on the site.
 
Connect to the admin center first using Connect-PnPOnline, then run Set-PnPTenantSite with the site URL and the owner's email, just make sure you have tenant admin permissions before running it or it won't work
 
Before you can assign a SharePoint site collection administrator using PnP PowerShell, you need either Global Admin or SharePoint Admin rights in Microsoft 365. Without these permissions, the Set-PnPSiteCollectionAdmin cmdlet will throw an access denied error. Make sure your account has the correct role assigned in the Microsoft 365 Admin Center before running any site admin commands.
 
After running the PnP PowerShell site collection admin command, verify it worked using Get-PnPSiteCollectionAdmin on the target site. This cmdlet returns a list of all current admins. If the user doesn't appear immediately, wait a minute and retry — SharePoint can take a short time to sync admin changes across the tenant after assignment.
 
In PnP PowerShell v1.12, you can add multiple site collection admins at once by passing a comma-separated list: Set-PnPTenantSite -Url [SiteURL] -Owners "user1@domain.com","user2@domain.com". This saves time when onboarding teams to a new SharePoint site. Always verify the users exist in your Microsoft 365 tenant before running the command to avoid errors.
 
Back
Top