There are many different ways for storing user settings in O365. This article should help choosing the best methods for your use cases.
Weiterlesen „The ultimate Guide for storing user settings in O365“CSOM: Set primary set collection admin
When creating modern site collections (e.g. sites with STS#3 Base Template) in SharePoint Online using CSOM the creator of the site will be automatically set as site owner and afterwards becomes site collection administrator afterwards.
To prevent this you have to change to primary site admin, remove old admin user from the site collection admins. This can be done in CSOM using the following logic.
Weiterlesen „CSOM: Set primary set collection admin“
Set O365 group / MS Team sharing state programmatically
Changing the sharing settings for a O365 group (and a MS Teams because the settings inside teams are controlled by the group settings) is a quite complex thing.
Update:
There’s currently a big problem with this method. You will need Directory.ReadWrite.All permissions for this. This is not an permission that should be given carelessly to anyone, as it grants extensive powers in the graph.
You can not set it in frontend at all. At least we can change it using MS Graph.
Weiterlesen „Set O365 group / MS Team sharing state programmatically“
SharePoint Online: Check in Javascript if the tenant is multi geo enabled
SharePoint Multi Geo tenant features have been enabled for some time. Users can switch between the different geo location. Using Javascript it is possible to check if the tenant is multi geo enabled.
Weiterlesen „SharePoint Online: Check in Javascript if the tenant is multi geo enabled“
PowerShell: SharePoint Online Authentication using AzureAd App certificate
Using azure ad apps it is possible to login to SharePoint Online using a certificate. This certificate could be loaded locally or from Azure Key Vault. The following method shows how to connect to SPO using an azure key vault certificate in memory.
You need to install PNP Online PowerShell and Azure PowerShell modules to enable to commands used in this scripts.
Weiterlesen „PowerShell: SharePoint Online Authentication using AzureAd App certificate“
Microsoft Graph: Updating user.prefferedLanguage does not work
Most of the properties of an O365 user can be updated using Microsoft graph. The app permissions needed to update this properties are fragmentary.
Weiterlesen „Microsoft Graph: Updating user.prefferedLanguage does not work“Set Site Collection Readonly programmatically using (new version)
Some time ago a I have posted some example code to set a site collection read only using a site policies and CSOM.
Now it is also possible to directly set a site collection readonly programmatically without a site policy. Weiterlesen „Set Site Collection Readonly programmatically using (new version)“
CSOM: Reset Access Request Settings
Some time ago Microsoft added a new functionality to send access request settings to the Site Owners instead of a single mail adress. This setting can also be set using SharePoint Client Object Model. Weiterlesen „CSOM: Reset Access Request Settings“
CSOM: Check if a date is in a webs workdays and / or workhours
The following function checks if a datetime is in the workdays and / or workhours of a SharePoint web.
Weiterlesen „CSOM: Check if a date is in a webs workdays and / or workhours“
CSOM: Check if a site is a modern site
The following Code checks if a site collection is a modern site (e.g. because it has a group connected or it is communication site).
Weiterlesen „CSOM: Check if a site is a modern site“