iTranslated by AI
The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🔧
Adding a User as a Site Collection Administrator in SharePoint
If you cannot add a user by calling Add to SPWeb.SiteAdministrators, you need to modify the properties of the SPUser object.
$site = Get-SPSite "http://sharepoint.example.com"
$user = $site.RootWeb.EnsureUser("EXAMPLE\testuser")
$user.IsSiteAdmin = $true
$user.Update()
Note that the site collection administrator that can be set from the Central Administration is the SPSite.Owner property. In the Japanese interface, both are referred to as Administrator (管理者), which is extremely confusing. It would be more appropriate to use the term Owner (所有者).
Discussion