Nov 04 2022 04:03 PM
I wish to automate various aspects of Sharepoint Online including site level but also organization level settings like external sharing etc. I don't see how to do this with the Graph REST API nor the Sharepoint Online CMDLETS. Anyone give a steer on how to achieve this?
Nov 05 2022 05:01 AM
Nov 05 2022 09:12 AM
# Getting client credential
$Credential = Get-Credential
# Exporting resources using credentials
Export-M365DSCConfiguration -Components @("SPOAccessControlSettings", "SPOApp", "SPOBrowserIdleSignout", "SPOHomeSite", "SPOHubSite", "SPOOrgAssetsLibrary", "SPOPropertyBag", "SPOSearchManagedProperty", "SPOSearchResultSource", "SPOSharingSettings", "SPOSite", "SPOSiteAuditSettings", "SPOSiteDesign", "SPOSiteDesignRights", "SPOSiteGroup", "SPOSiteScript", "SPOStorageEntity", "SPOTenantCdnEnabled", "SPOTenantCdnPolicy", "SPOTenantSettings", "SPOTheme", "SPOUserProfileProperty") -Credential $Credential
Nov 06 2022 01:24 PM
Nov 06 2022 01:25 PM
Nov 06 2022 01:58 PM
Nov 06 2022 10:58 PM
Internally they use the "Get-PnPTenant" Command from PnP Powershell.
I am not 100% sure, but I assume they are using the CSOM Library in that command
https://github.com/pnp/powershell/blob/dev/src/Commands/Admin/GetTenant.cs
Nov 06 2022 11:47 PM
@shocko You should know, if not already understood, that we are talking about quite different things here. What @SvenSieverding are posting about are multiple settings, while I'm posting about the ability to control all external access and external sharing settings for sites using sensitivity labels. Your use case isn't clear and not sure what settings you want to configure.