PowerShell Per Site Collection using pnp-powershell
Category: SharePoint
Change Primary Administrator of SharePoint Online Site using PnP PowerShell
Changing the Primary Administrator First connect to SharePoint Online admin center $connection = Connect-PnPOnline -Url https://YourTenant-admin.sharepoint.com -Credentials (Get-Credential) -ReturnConnection Then get the Site $site = Get-PnPTenantSite -Url https://YourTenant.sharepoint.com/sites/SiteAlias -Connection $connection Then update the Owner (same as Primary Administrator) using the new Primary Administrators Email/UserPrincipalName. $site.Owner = “user@domain.com” $site.Update() $site.Context.ExecuteQuery() Verifying the Primary Administrator Connect to […]
Creating a List Item via the SharePoint REST API results in Error (500) Internal Server Error
The below is done in PowerShell, but I imagine other languages supports the same features as well. When utilizing the SharePoint REST API to create a new List Item which contains characters such as æ, ø, or å you might get a response of Error (500) Internal Server Error. The reponse might also include the […]
Saving time and bandwidth by reviewing/refactoring old code
Prelude I build multiple minor web apps at work. They might be forms for data collection, or registries with basic CRUD (Create, Read, Update, Delete) capabilities. These are written in HTML/JS/CSS and hosted on SharePoint – utilizing the SharePoint REST API to handle storage and permissions. When data is stored in a SharePoint list, I […]
Accessing MS Graph from static HTML page on SharePoint Online
In my previous post I described how it is possible to host static HTML pages on SharePoint Online by allowing Custom Scripts. After doing so, I wanted to access MS Graph in order to tap into the ever growing data it holds. I had a hard time finding a solution that would allow accessing MS […]
Host static HTML page on SharePoint Online
Coming from SharePoint On Premise I have been used to use SharePoint as a host for simple HTML and JS pages. Usually I created a Document Library or Custom List, then browsed to the created folder via webdav and uploaded the files. On SharePoint Online however, I had a hard time getting this to work. […]