From 61d10a140b88c97aba9d32fd2e79b7f916aa1f99 Mon Sep 17 00:00:00 2001 From: Koen Zomers Date: Fri, 10 Nov 2023 15:56:54 +0100 Subject: [PATCH] Adding request file links properties to site and tenant output (#3557) * Cleanup of the file. Removing separate private properties and replacing by get/set properties to simplify. * Adding CoreRequestFilesLinkEnabled, CoreRequestFilesLinkExpirationInDays, OneDriveRequestFilesLinkEnabled and OneDriveRequestFilesLinkExpirationInDays * Adding RequestFilesLinkEnabled and RequestFilesLinkExpirationInDays * Adding changelog entry * Added BusinessConnectivityServiceDisabled --------- Co-authored-by: Gautam Sheth --- CHANGELOG.md | 2 + src/Commands/Model/SPOSite.cs | 10 +- src/Commands/Model/SPOTenant.cs | 801 +++++++++++++------------------- 3 files changed, 329 insertions(+), 484 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b678f04d..49abfff91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Added `-RelativeUrl` parameter to `Connect-PnPOnline` cmdlet to allow specifying custom URLs for usage with `-WebLogin` method. [#3530](https://github.com/pnp/powershell/pull/3530) - Added `-RetryCount` to `Submit-PnPSearchQuery` which allows for specifying the number of retries to perform when an exception occurs [#3528](https://github.com/pnp/powershell/pull/3528) - Added `-MailNickname` parameter to `Set-PnPMicrosoft365Group` cmdlet to allow changing of this property on a Microsoft 365 Group [#3529](https://github.com/pnp/powershell/pull/3529) +- Added `RequestFilesLinkEnabled` and `RequestFilesLinkExpirationInDays` to the output of `Get-PnPSite` [#3557](https://github.com/pnp/powershell/pull/3557) +- Added `CoreRequestFilesLinkEnabled`, `CoreRequestFilesLinkExpirationInDays`, `OneDriveRequestFilesLinkEnabled`, `OneDriveRequestFilesLinkExpirationInDays`, `BusinessConnectivityServiceDisabled` to the output of `Get-PnPTenant` [#3557](https://github.com/pnp/powershell/pull/3557) - Added `-BusinessConnectivityServiceDisabled` parameter to `Set-PnPTenant` cmdlt to allow disabling the Business Connectivity Service [#3562](https://github.com/pnp/powershell/pull/3562) ### Fixed diff --git a/src/Commands/Model/SPOSite.cs b/src/Commands/Model/SPOSite.cs index 90018dbe4..975dfd1bf 100644 --- a/src/Commands/Model/SPOSite.cs +++ b/src/Commands/Model/SPOSite.cs @@ -5,6 +5,7 @@ namespace PnP.PowerShell.Commands.Model { public class SPOSite { + #region Properties public bool AllowDownloadingNonWebViewableFiles { get; set; } public bool AllowEditing { get; set; } public bool AllowSelfServiceUpgrade { get; set; } @@ -67,6 +68,11 @@ public class SPOSite public string Title { get; set; } public string Url { get; set; } public int WebsCount { get; set; } + public bool? RequestFilesLinkEnabled { private set; get; } + public int? RequestFilesLinkExpirationInDays { private set; get; } + + #endregion + public SPOSite(SiteProperties props, bool? disableSharingForNonOwnersStatus) { AllowDownloadingNonWebViewableFiles = props.AllowDownloadingNonWebViewableFiles; @@ -128,7 +134,9 @@ public SPOSite(SiteProperties props, bool? disableSharingForNonOwnersStatus) Template = props.Template; Title = props.Title; WebsCount = props.WebsCount; - Url = props.Url; + Url = props.Url; + RequestFilesLinkEnabled = props.RequestFilesLinkEnabled; + RequestFilesLinkExpirationInDays = props.RequestFilesLinkExpirationInDays; } } diff --git a/src/Commands/Model/SPOTenant.cs b/src/Commands/Model/SPOTenant.cs index 8c0b4a779..7492005db 100644 --- a/src/Commands/Model/SPOTenant.cs +++ b/src/Commands/Model/SPOTenant.cs @@ -9,209 +9,383 @@ namespace PnP.PowerShell.Commands.Model { public class SPOTenant { + #region Properties + + public bool HideDefaultThemes { private set; get; } + + public long StorageQuota { private set; get; } + + public long StorageQuotaAllocated { private set; get; } + + public double ResourceQuota { private set; get; } + + public double ResourceQuotaAllocated { private set; get; } + + public double OneDriveStorageQuota { private set; get; } + + public string CompatibilityRange { private set; get; } + + public bool ExternalServicesEnabled { private set; get; } + public string NoAccessRedirectUrl { private set; get; } + + public SharingCapabilities SharingCapability { private set; get; } + + public bool DisplayStartASiteOption { private set; get; } + + public string StartASiteFormUrl { private set; get; } + + public bool ShowEveryoneClaim { private set; get; } + + public bool ShowAllUsersClaim { private set; get; } + + public bool OfficeClientADALDisabled { private set; get; } + + public bool LegacyAuthProtocolsEnabled { private set; get; } + + public bool ShowEveryoneExceptExternalUsersClaim { private set; get; } + + public bool SearchResolveExactEmailOrUPN { private set; get; } + + public bool RequireAcceptingAccountMatchInvitedAccount { private set; get; } + public bool ProvisionSharedWithEveryoneFolder { private set; get; } + + public string SignInAccelerationDomain { private set; get; } + public bool EnableGuestSignInAcceleration { private set; get; } + + public bool UsePersistentCookiesForExplorerView { private set; get; } + + public bool BccExternalSharingInvitations { private set; get; } + + public string BccExternalSharingInvitationsList { private set; get; } + + public bool UserVoiceForFeedbackEnabled { private set; get; } + + public bool PublicCdnEnabled { private set; get; } + + public string PublicCdnAllowedFileTypes { private set; get; } + + public IList PublicCdnOrigins { private set; get; } + + public int RequireAnonymousLinksExpireInDays { private set; get; } + + public string SharingAllowedDomainList { private set; get; } + + public string SharingBlockedDomainList { private set; get; } + + public SharingDomainRestrictionModes SharingDomainRestrictionMode { private set; get; } + + public bool OneDriveForGuestsEnabled { private set; get; } + + public bool IPAddressEnforcement { private set; get; } + + public string IPAddressAllowList { private set; get; } + + public int IPAddressWACTokenLifetime { private set; get; } + + public bool UseFindPeopleInPeoplePicker { private set; get; } + + public SharingLinkType DefaultSharingLinkType { private set; get; } + + public SharingState ODBMembersCanShare { private set; get; } + + public SharingState ODBAccessRequests { private set; get; } + + public bool PreventExternalUsersFromResharing { private set; get; } + + public bool ShowPeoplePickerSuggestionsForGuestUsers { private set; get; } + + public AnonymousLinkType FileAnonymousLinkType { private set; get; } + + public AnonymousLinkType FolderAnonymousLinkType { private set; get; } + + public bool NotifyOwnersWhenItemsReshared { private set; get; } + + public bool NotifyOwnersWhenInvitationsAccepted { private set; get; } + + public bool NotificationsInOneDriveForBusinessEnabled { private set; get; } + + public bool NotificationsInSharePointEnabled { private set; get; } + + public SpecialCharactersState SpecialCharactersStateInFileFolderNames { private set; get; } + + public bool OwnerAnonymousNotification { private set; get; } + + public bool CommentsOnSitePagesDisabled { private set; get; } + + public bool SocialBarOnSitePagesDisabled { private set; get; } + + public int OrphanedPersonalSitesRetentionPeriod { private set; get; } + + public bool PermissiveBrowserFileHandlingOverride { private set; get; } + + public bool DisallowInfectedFileDownload { private set; get; } + + public SharingPermissionType DefaultLinkPermission { private set; get; } + + public SPOConditionalAccessPolicyType ConditionalAccessPolicy { private set; get; } + + public bool AllowDownloadingNonWebViewableFiles { private set; get; } + + public bool AllowEditing { private set; get; } + + public bool ApplyAppEnforcedRestrictionsToAdHocRecipients { private set; get; } + + public bool FilePickerExternalImageSearchEnabled { private set; get; } + + public bool EmailAttestationRequired { private set; get; } + + public int EmailAttestationReAuthDays { private set; get; } + + public Guid[] DisabledWebPartIds { private set; get; } + + public bool DisableCustomAppAuthentication { private set; get; } + + public SensitiveByDefaultState MarkNewFilesSensitiveByDefault { private set; get; } + + public bool StopNew2013Workflows { private set; get; } + + public bool ViewInFileExplorerEnabled { private set; get; } + + public bool DisableSpacesActivation { private set; get; } + + public bool? AllowFilesWithKeepLabelToBeDeletedSPO { private set; get; } + + public bool? AllowFilesWithKeepLabelToBeDeletedODB { private set; get; } + + public bool DisableAddToOneDrive { private set; get; } + + public bool IsFluidEnabled { private set; get; } + public bool DisablePersonalListCreation { private set; get; } + + public bool ExternalUserExpirationRequired { private set; get; } + + public int ExternalUserExpireInDays { private set; get; } + + public bool DisplayNamesOfFileViewers { private set; get; } + + public bool DisplayNamesOfFileViewersInSpo { private set; get; } + public bool IsLoopEnabled { private set; get; } + public Guid[] DisabledModernListTemplateIds { private set; get; } + public bool RestrictedAccessControl { private set; get; } + public bool DisableDocumentLibraryDefaultLabeling { private set; get; } + public bool IsEnableAppAuthPopUpEnabled { private set; get; } + public int? ExpireVersionsAfterDays { private set; get; } + public int? MajorVersionLimit { private set; get; } + public bool? EnableAutoExpirationVersionTrim { private set; get; } + public bool? EnableAzureADB2BIntegration { private set; get; } + public bool? SiteOwnerManageLegacyServicePrincipalEnabled { private set; get; } + public bool? CoreRequestFilesLinkEnabled { private set; get; } + public int? CoreRequestFilesLinkExpirationInDays { private set; get; } + public bool? OneDriveRequestFilesLinkEnabled { private set; get; } + public int? OneDriveRequestFilesLinkExpirationInDays { private set; get; } + + public bool? BusinessConnectivityServiceDisabled { private set; get; } + + #endregion + public SPOTenant(Tenant tenant, ClientContext clientContext) { - this.hideDefaultThemes = tenant.HideDefaultThemes; - this.storageQuota = tenant.StorageQuota; - this.storageQuotaAllocated = tenant.StorageQuotaAllocated; - this.resourceQuota = tenant.ResourceQuota; - this.resourceQuotaAllocated = tenant.ResourceQuotaAllocated; - this.oneDriveStorageQuota = tenant.OneDriveStorageQuota; - this.compatibilityRange = tenant.CompatibilityRange; - this.externalServicesEnabled = tenant.ExternalServicesEnabled; - this.noAccessRedirectUrl = tenant.NoAccessRedirectUrl; - this.sharingCapability = tenant.SharingCapability; - this.displayStartASiteOption = tenant.DisplayStartASiteOption; - this.startASiteFormUrl = tenant.StartASiteFormUrl; - this.showEveryoneClaim = tenant.ShowEveryoneClaim; - this.showAllUsersClaim = tenant.ShowAllUsersClaim; - this.officeClientADALDisabled = tenant.OfficeClientADALDisabled; - this.orphanedPersonalSitesRetentionPeriod = tenant.OrphanedPersonalSitesRetentionPeriod; - this.legacyAuthProtocolsEnabled = tenant.LegacyAuthProtocolsEnabled; - this.showEveryoneExceptExternalUsersClaim = tenant.ShowEveryoneExceptExternalUsersClaim; - this.searchResolveExactEmailOrUPN = tenant.SearchResolveExactEmailOrUPN; - this.requireAcceptingAccountMatchInvitedAccount = tenant.RequireAcceptingAccountMatchInvitedAccount; - this.provisionSharedWithEveryoneFolder = tenant.ProvisionSharedWithEveryoneFolder; - this.signInAccelerationDomain = tenant.SignInAccelerationDomain; - this.disabledWebPartIds = tenant.DisabledWebPartIds; - this.stopNew2013Workflows = tenant.StopNew2013Workflows; - this.viewInFileExplorerEnabled = tenant.ViewInFileExplorerEnabled; - this.externalUserExpirationRequired = tenant.ExternalUserExpirationRequired; - this.externalUserExpireInDays = tenant.ExternalUserExpireInDays; - this.displayNamesOfFileViewers = tenant.DisplayNamesOfFileViewers; - this.displayNamesOfFileViewersInSpo = tenant.DisplayNamesOfFileViewersInSpo; - this.isLoopEnabled = tenant.IsLoopEnabled; - this.enableAzureADB2BIntegration = tenant.EnableAzureADB2BIntegration; - this.siteOwnerManageLegacyServicePrincipalEnabled = tenant.SiteOwnerManageLegacyServicePrincipalEnabled; + HideDefaultThemes = tenant.HideDefaultThemes; + StorageQuota = tenant.StorageQuota; + StorageQuotaAllocated = tenant.StorageQuotaAllocated; + ResourceQuota = tenant.ResourceQuota; + ResourceQuotaAllocated = tenant.ResourceQuotaAllocated; + OneDriveStorageQuota = tenant.OneDriveStorageQuota; + CompatibilityRange = tenant.CompatibilityRange; + ExternalServicesEnabled = tenant.ExternalServicesEnabled; + NoAccessRedirectUrl = tenant.NoAccessRedirectUrl; + SharingCapability = tenant.SharingCapability; + DisplayStartASiteOption = tenant.DisplayStartASiteOption; + StartASiteFormUrl = tenant.StartASiteFormUrl; + ShowEveryoneClaim = tenant.ShowEveryoneClaim; + ShowAllUsersClaim = tenant.ShowAllUsersClaim; + OfficeClientADALDisabled = tenant.OfficeClientADALDisabled; + OrphanedPersonalSitesRetentionPeriod = tenant.OrphanedPersonalSitesRetentionPeriod; + LegacyAuthProtocolsEnabled = tenant.LegacyAuthProtocolsEnabled; + ShowEveryoneExceptExternalUsersClaim = tenant.ShowEveryoneExceptExternalUsersClaim; + SearchResolveExactEmailOrUPN = tenant.SearchResolveExactEmailOrUPN; + RequireAcceptingAccountMatchInvitedAccount = tenant.RequireAcceptingAccountMatchInvitedAccount; + ProvisionSharedWithEveryoneFolder = tenant.ProvisionSharedWithEveryoneFolder; + SignInAccelerationDomain = tenant.SignInAccelerationDomain; + DisabledWebPartIds = tenant.DisabledWebPartIds; + StopNew2013Workflows = tenant.StopNew2013Workflows; + ViewInFileExplorerEnabled = tenant.ViewInFileExplorerEnabled; + ExternalUserExpirationRequired = tenant.ExternalUserExpirationRequired; + ExternalUserExpireInDays = tenant.ExternalUserExpireInDays; + DisplayNamesOfFileViewers = tenant.DisplayNamesOfFileViewers; + DisplayNamesOfFileViewersInSpo = tenant.DisplayNamesOfFileViewersInSpo; + IsLoopEnabled = tenant.IsLoopEnabled; + EnableAzureADB2BIntegration = tenant.EnableAzureADB2BIntegration; + SiteOwnerManageLegacyServicePrincipalEnabled = tenant.SiteOwnerManageLegacyServicePrincipalEnabled; try { - this.enableGuestSignInAcceleration = tenant.EnableGuestSignInAcceleration; + EnableGuestSignInAcceleration = tenant.EnableGuestSignInAcceleration; } catch { - this.enableGuestSignInAcceleration = false; + EnableGuestSignInAcceleration = false; } - this.usePersistentCookiesForExplorerView = tenant.UsePersistentCookiesForExplorerView; - this.bccExternalSharingInvitations = tenant.BccExternalSharingInvitations; - this.bccExternalSharingInvitationsList = tenant.BccExternalSharingInvitationsList; + UsePersistentCookiesForExplorerView = tenant.UsePersistentCookiesForExplorerView; + BccExternalSharingInvitations = tenant.BccExternalSharingInvitations; + BccExternalSharingInvitationsList = tenant.BccExternalSharingInvitationsList; try { - this.useFindPeopleInPeoplePicker = tenant.UseFindPeopleInPeoplePicker; + UseFindPeopleInPeoplePicker = tenant.UseFindPeopleInPeoplePicker; } catch { - this.useFindPeopleInPeoplePicker = false; + UseFindPeopleInPeoplePicker = false; } try { - this.userVoiceForFeedbackEnabled = tenant.UserVoiceForFeedbackEnabled; + UserVoiceForFeedbackEnabled = tenant.UserVoiceForFeedbackEnabled; } catch { - this.userVoiceForFeedbackEnabled = true; + UserVoiceForFeedbackEnabled = true; } try { - this.requireAnonymousLinksExpireInDays = tenant.RequireAnonymousLinksExpireInDays; + RequireAnonymousLinksExpireInDays = tenant.RequireAnonymousLinksExpireInDays; } catch { - this.requireAnonymousLinksExpireInDays = 0; + RequireAnonymousLinksExpireInDays = 0; } - this.sharingAllowedDomainList = tenant.SharingAllowedDomainList; - this.sharingBlockedDomainList = tenant.SharingBlockedDomainList; - this.sharingDomainRestrictionMode = tenant.SharingDomainRestrictionMode; + SharingAllowedDomainList = tenant.SharingAllowedDomainList; + SharingBlockedDomainList = tenant.SharingBlockedDomainList; + SharingDomainRestrictionMode = tenant.SharingDomainRestrictionMode; try { - this.oneDriveStorageQuota = tenant.OneDriveStorageQuota; + OneDriveStorageQuota = tenant.OneDriveStorageQuota; } catch { - this.oneDriveStorageQuota = 0L; + OneDriveStorageQuota = 0L; } - this.oneDriveForGuestsEnabled = tenant.OneDriveForGuestsEnabled; + OneDriveForGuestsEnabled = tenant.OneDriveForGuestsEnabled; try { - this.ipAddressEnforcement = tenant.IPAddressEnforcement; + IPAddressEnforcement = tenant.IPAddressEnforcement; } catch { - this.ipAddressEnforcement = false; + IPAddressEnforcement = false; } try { - this.ipAddressAllowList = tenant.IPAddressAllowList; + IPAddressAllowList = tenant.IPAddressAllowList; } catch { - this.ipAddressAllowList = ""; + IPAddressAllowList = ""; } try { - this.ipAddressWACTokenLifetime = tenant.IPAddressWACTokenLifetime; + IPAddressWACTokenLifetime = tenant.IPAddressWACTokenLifetime; } catch { - this.ipAddressWACTokenLifetime = 600; + IPAddressWACTokenLifetime = 600; } try { - this.defaultSharingLinkType = tenant.DefaultSharingLinkType; + DefaultSharingLinkType = tenant.DefaultSharingLinkType; } catch { - this.defaultSharingLinkType = SharingLinkType.None; + DefaultSharingLinkType = SharingLinkType.None; } try { - this.showPeoplePickerSuggestionsForGuestUsers = tenant.ShowPeoplePickerSuggestionsForGuestUsers; + ShowPeoplePickerSuggestionsForGuestUsers = tenant.ShowPeoplePickerSuggestionsForGuestUsers; } catch { - this.showPeoplePickerSuggestionsForGuestUsers = false; + ShowPeoplePickerSuggestionsForGuestUsers = false; } try { - this.odbMembersCanShare = tenant.ODBMembersCanShare; + ODBMembersCanShare = tenant.ODBMembersCanShare; } catch { - this.odbMembersCanShare = SharingState.Unspecified; + ODBMembersCanShare = SharingState.Unspecified; } try { - this.odbAccessRequests = tenant.ODBAccessRequests; + ODBAccessRequests = tenant.ODBAccessRequests; } catch { - this.odbAccessRequests = SharingState.Unspecified; + ODBAccessRequests = SharingState.Unspecified; } try { - this.preventExternalUsersFromResharing = tenant.PreventExternalUsersFromResharing; + PreventExternalUsersFromResharing = tenant.PreventExternalUsersFromResharing; } catch { - this.preventExternalUsersFromResharing = false; + PreventExternalUsersFromResharing = false; } try { - this.publicCdnEnabled = tenant.PublicCdnEnabled; + PublicCdnEnabled = tenant.PublicCdnEnabled; } catch { - this.publicCdnEnabled = false; + PublicCdnEnabled = false; } try { - this.publicCdnAllowedFileTypes = tenant.PublicCdnAllowedFileTypes; + PublicCdnAllowedFileTypes = tenant.PublicCdnAllowedFileTypes; } catch { - this.publicCdnAllowedFileTypes = string.Empty; + PublicCdnAllowedFileTypes = string.Empty; } try { - this.notifyOwnersWhenItemsReshared = tenant.NotifyOwnersWhenItemsReshared; + NotifyOwnersWhenItemsReshared = tenant.NotifyOwnersWhenItemsReshared; } catch { - this.notifyOwnersWhenItemsReshared = true; + NotifyOwnersWhenItemsReshared = true; } try { - this.notifyOwnersWhenInvitationsAccepted = tenant.NotifyOwnersWhenInvitationsAccepted; + NotifyOwnersWhenInvitationsAccepted = tenant.NotifyOwnersWhenInvitationsAccepted; } catch { - this.notifyOwnersWhenInvitationsAccepted = true; + NotifyOwnersWhenInvitationsAccepted = true; } try { - this.notificationsInOneDriveForBusinessEnabled = tenant.NotificationsInOneDriveForBusinessEnabled; + NotificationsInOneDriveForBusinessEnabled = tenant.NotificationsInOneDriveForBusinessEnabled; } catch { - this.notificationsInOneDriveForBusinessEnabled = true; + NotificationsInOneDriveForBusinessEnabled = true; } try { - this.notificationsInSharePointEnabled = tenant.NotificationsInSharePointEnabled; + NotificationsInSharePointEnabled = tenant.NotificationsInSharePointEnabled; } catch { - this.notificationsInSharePointEnabled = true; + NotificationsInSharePointEnabled = true; } try { - this.ownerAnonymousNotification = tenant.OwnerAnonymousNotification; + OwnerAnonymousNotification = tenant.OwnerAnonymousNotification; } catch { - this.ownerAnonymousNotification = true; + OwnerAnonymousNotification = true; } - this.publicCdnOrigins = new List(); + PublicCdnOrigins = new List(); try { tenant.PublicCdnOrigins.ToList().ForEach(delegate (string s) @@ -220,7 +394,7 @@ public SPOTenant(Tenant tenant, ClientContext clientContext) { ',' }); - this.publicCdnOrigins.Add(new SPOPublicCdnOrigin(array[1], array[0])); + PublicCdnOrigins.Add(new SPOPublicCdnOrigin(array[1], array[0])); }); } catch @@ -228,185 +402,185 @@ public SPOTenant(Tenant tenant, ClientContext clientContext) } try { - this.fileAnonymousLinkType = tenant.FileAnonymousLinkType; + FileAnonymousLinkType = tenant.FileAnonymousLinkType; } catch { - this.fileAnonymousLinkType = AnonymousLinkType.None; + FileAnonymousLinkType = Microsoft.SharePoint.Client.AnonymousLinkType.None; } try { - this.folderAnonymousLinkType = tenant.FolderAnonymousLinkType; + FolderAnonymousLinkType = tenant.FolderAnonymousLinkType; } catch { - this.folderAnonymousLinkType = AnonymousLinkType.None; + FolderAnonymousLinkType = Microsoft.SharePoint.Client.AnonymousLinkType.None; } try { - this.permissiveBrowserFileHandlingOverride = tenant.PermissiveBrowserFileHandlingOverride; + PermissiveBrowserFileHandlingOverride = tenant.PermissiveBrowserFileHandlingOverride; } catch { - this.permissiveBrowserFileHandlingOverride = false; + PermissiveBrowserFileHandlingOverride = false; } try { - this.specialCharactersStateInFileFolderNames = tenant.SpecialCharactersStateInFileFolderNames; + SpecialCharactersStateInFileFolderNames = tenant.SpecialCharactersStateInFileFolderNames; } catch { - this.specialCharactersStateInFileFolderNames = SpecialCharactersState.NoPreference; + SpecialCharactersStateInFileFolderNames = SpecialCharactersState.NoPreference; } try { - this.disallowInfectedFileDownload = tenant.DisallowInfectedFileDownload; + DisallowInfectedFileDownload = tenant.DisallowInfectedFileDownload; } catch { - this.disallowInfectedFileDownload = false; + DisallowInfectedFileDownload = false; } try { - this.commentsOnSitePagesDisabled = tenant.CommentsOnSitePagesDisabled; + CommentsOnSitePagesDisabled = tenant.CommentsOnSitePagesDisabled; } catch { - this.commentsOnSitePagesDisabled = false; + CommentsOnSitePagesDisabled = false; } try { - this.socialBarOnSitePagesDisabled = tenant.SocialBarOnSitePagesDisabled; + SocialBarOnSitePagesDisabled = tenant.SocialBarOnSitePagesDisabled; } catch { - this.socialBarOnSitePagesDisabled = true; + SocialBarOnSitePagesDisabled = true; } try { - this.defaultLinkPermission = tenant.DefaultLinkPermission; + DefaultLinkPermission = tenant.DefaultLinkPermission; } catch { - this.defaultLinkPermission = SharingPermissionType.None; + DefaultLinkPermission = SharingPermissionType.None; } try { - this.conditionalAccessPolicy = tenant.ConditionalAccessPolicy; + ConditionalAccessPolicy = tenant.ConditionalAccessPolicy; } catch { - this.conditionalAccessPolicy = SPOConditionalAccessPolicyType.AllowFullAccess; + ConditionalAccessPolicy = SPOConditionalAccessPolicyType.AllowFullAccess; } try { - this.allowDownloadingNonWebViewableFiles = tenant.AllowDownloadingNonWebViewableFiles; + AllowDownloadingNonWebViewableFiles = tenant.AllowDownloadingNonWebViewableFiles; } catch { - this.allowDownloadingNonWebViewableFiles = true; + AllowDownloadingNonWebViewableFiles = true; } try { - this.allowEditing = tenant.AllowEditing; + AllowEditing = tenant.AllowEditing; } catch { - this.allowEditing = true; + AllowEditing = true; } try { - this.applyAppEnforcedRestrictionsToAdHocRecipients = tenant.ApplyAppEnforcedRestrictionsToAdHocRecipients; + ApplyAppEnforcedRestrictionsToAdHocRecipients = tenant.ApplyAppEnforcedRestrictionsToAdHocRecipients; } catch { - this.applyAppEnforcedRestrictionsToAdHocRecipients = true; + ApplyAppEnforcedRestrictionsToAdHocRecipients = true; } try { - this.filePickerExternalImageSearchEnabled = tenant.FilePickerExternalImageSearchEnabled; + FilePickerExternalImageSearchEnabled = tenant.FilePickerExternalImageSearchEnabled; } catch { - this.filePickerExternalImageSearchEnabled = true; + FilePickerExternalImageSearchEnabled = true; } try { - this.emailAttestationRequired = tenant.EmailAttestationRequired; + EmailAttestationRequired = tenant.EmailAttestationRequired; } catch { - this.emailAttestationRequired = false; + EmailAttestationRequired = false; } try { - this.emailAttestationReAuthDays = tenant.EmailAttestationReAuthDays; + EmailAttestationReAuthDays = tenant.EmailAttestationReAuthDays; } catch { - this.emailAttestationReAuthDays = 30; + EmailAttestationReAuthDays = 30; } try { - this.disableCustomAppAuthentication = tenant.DisableCustomAppAuthentication; + DisableCustomAppAuthentication = tenant.DisableCustomAppAuthentication; } catch { - this.disableCustomAppAuthentication = false; + DisableCustomAppAuthentication = false; } - this.markNewFilesSensitiveByDefault = tenant.MarkNewFilesSensitiveByDefault; + MarkNewFilesSensitiveByDefault = tenant.MarkNewFilesSensitiveByDefault; try { - this.disableSpacesActivation = tenant.DisableSpacesActivation; + DisableSpacesActivation = tenant.DisableSpacesActivation; } catch { - this.disableSpacesActivation = false; + DisableSpacesActivation = false; } try { - this.disableAddToOneDrive = tenant.DisableAddToOneDrive; + DisableAddToOneDrive = tenant.DisableAddToOneDrive; } catch { - this.disableAddToOneDrive = false; + DisableAddToOneDrive = false; } try { - this.isFluidEnabled = tenant.IsFluidEnabled; + IsFluidEnabled = tenant.IsFluidEnabled; } catch { - this.isFluidEnabled = false; + IsFluidEnabled = false; } try { - this.disablePersonalListCreation = tenant.DisablePersonalListCreation; + DisablePersonalListCreation = tenant.DisablePersonalListCreation; } catch { - this.disablePersonalListCreation = false; + DisablePersonalListCreation = false; } - this.disabledModernListTemplateIds = tenant.DisabledModernListTemplateIds; - this.restrictedAccessControl = tenant.EnableRestrictedAccessControl; + DisabledModernListTemplateIds = tenant.DisabledModernListTemplateIds; + RestrictedAccessControl = tenant.EnableRestrictedAccessControl; try { - this.disableDocumentLibraryDefaultLabeling = tenant.DisableDocumentLibraryDefaultLabeling; + DisableDocumentLibraryDefaultLabeling = tenant.DisableDocumentLibraryDefaultLabeling; } catch { - this.disableDocumentLibraryDefaultLabeling = false; + DisableDocumentLibraryDefaultLabeling = false; } try { - this.isEnableAppAuthPopUpEnabled = tenant.IsEnableAppAuthPopUpEnabled; + IsEnableAppAuthPopUpEnabled = tenant.IsEnableAppAuthPopUpEnabled; } catch { - this.isEnableAppAuthPopUpEnabled = false; + IsEnableAppAuthPopUpEnabled = false; } try @@ -415,41 +589,41 @@ public SPOTenant(Tenant tenant, ClientContext clientContext) var getAllowFilesWithKeepLabelToBeDeletedODB = Microsoft.SharePoint.Client.CompliancePolicy.SPPolicyStoreProxy.GetAllowFilesWithKeepLabelToBeDeletedODB(clientContext); clientContext.ExecuteQueryRetry(); - this.allowFilesWithKeepLabelToBeDeletedSPO = getAllowFilesWithKeepLabelToBeDeletedSPO.Value; - this.allowFilesWithKeepLabelToBeDeletedODB = getAllowFilesWithKeepLabelToBeDeletedODB.Value; + AllowFilesWithKeepLabelToBeDeletedSPO = getAllowFilesWithKeepLabelToBeDeletedSPO.Value; + AllowFilesWithKeepLabelToBeDeletedODB = getAllowFilesWithKeepLabelToBeDeletedODB.Value; } catch { } try { - this.expireVersionsAfterDays = tenant.ExpireVersionsAfterDays; + ExpireVersionsAfterDays = tenant.ExpireVersionsAfterDays; } catch { - this.expireVersionsAfterDays = 0; + ExpireVersionsAfterDays = 0; } try { - this.majorVersionLimit = tenant.MajorVersionLimit; + MajorVersionLimit = tenant.MajorVersionLimit; } catch { - this.majorVersionLimit = 0; + MajorVersionLimit = 0; } try { - this.enableAutoExpirationVersionTrim = tenant.EnableAutoExpirationVersionTrim; + EnableAutoExpirationVersionTrim = tenant.EnableAutoExpirationVersionTrim; } catch { - this.enableAutoExpirationVersionTrim = false; + EnableAutoExpirationVersionTrim = false; } try { - this.enableAzureADB2BIntegration = tenant.EnableAzureADB2BIntegration; + EnableAzureADB2BIntegration = tenant.EnableAzureADB2BIntegration; } catch { @@ -457,356 +631,17 @@ public SPOTenant(Tenant tenant, ClientContext clientContext) try { - this.siteOwnerManageLegacyServicePrincipalEnabled = tenant.SiteOwnerManageLegacyServicePrincipalEnabled; + SiteOwnerManageLegacyServicePrincipalEnabled = tenant.SiteOwnerManageLegacyServicePrincipalEnabled; } catch { } - } - - public bool HideDefaultThemes => hideDefaultThemes; - - public long StorageQuota => storageQuota; - - public long StorageQuotaAllocated => storageQuotaAllocated; - - public double ResourceQuota => resourceQuota; - - public double ResourceQuotaAllocated => resourceQuotaAllocated; - - public double OneDriveStorageQuota => oneDriveStorageQuota; - - public string CompatibilityRange => compatibilityRange; - - public bool ExternalServicesEnabled => externalServicesEnabled; - - public string NoAccessRedirectUrl => noAccessRedirectUrl; - - public SharingCapabilities SharingCapability => sharingCapability; - - public bool DisplayStartASiteOption => displayStartASiteOption; - - public string StartASiteFormUrl => startASiteFormUrl; - - public bool ShowEveryoneClaim => showEveryoneClaim; - - public bool ShowAllUsersClaim => showAllUsersClaim; - - public bool OfficeClientADALDisabled => officeClientADALDisabled; - - public bool LegacyAuthProtocolsEnabled => legacyAuthProtocolsEnabled; - - public bool ShowEveryoneExceptExternalUsersClaim => showEveryoneExceptExternalUsersClaim; - - public bool SearchResolveExactEmailOrUPN => searchResolveExactEmailOrUPN; - - public bool RequireAcceptingAccountMatchInvitedAccount => requireAcceptingAccountMatchInvitedAccount; - - public bool ProvisionSharedWithEveryoneFolder => provisionSharedWithEveryoneFolder; - - public string SignInAccelerationDomain => signInAccelerationDomain; - - public bool EnableGuestSignInAcceleration => enableGuestSignInAcceleration; - - public bool UsePersistentCookiesForExplorerView => usePersistentCookiesForExplorerView; - - public bool BccExternalSharingInvitations => bccExternalSharingInvitations; - - public string BccExternalSharingInvitationsList => bccExternalSharingInvitationsList; - - public bool UserVoiceForFeedbackEnabled => userVoiceForFeedbackEnabled; - - public bool PublicCdnEnabled => publicCdnEnabled; - - public string PublicCdnAllowedFileTypes => publicCdnAllowedFileTypes; - - public IList PublicCdnOrigins => publicCdnOrigins; - - public int RequireAnonymousLinksExpireInDays => requireAnonymousLinksExpireInDays; - - public string SharingAllowedDomainList => sharingAllowedDomainList; - - public string SharingBlockedDomainList => sharingBlockedDomainList; - - public SharingDomainRestrictionModes SharingDomainRestrictionMode => sharingDomainRestrictionMode; - - public bool OneDriveForGuestsEnabled => oneDriveForGuestsEnabled; - - public bool IPAddressEnforcement => ipAddressEnforcement; - - public string IPAddressAllowList => ipAddressAllowList; - - public int IPAddressWACTokenLifetime => ipAddressWACTokenLifetime; - - public bool UseFindPeopleInPeoplePicker => useFindPeopleInPeoplePicker; - - public SharingLinkType DefaultSharingLinkType => defaultSharingLinkType; - - public SharingState ODBMembersCanShare => odbMembersCanShare; - - public SharingState ODBAccessRequests => odbAccessRequests; - - public bool PreventExternalUsersFromResharing => preventExternalUsersFromResharing; - - public bool ShowPeoplePickerSuggestionsForGuestUsers => showPeoplePickerSuggestionsForGuestUsers; - - public AnonymousLinkType FileAnonymousLinkType => fileAnonymousLinkType; - public AnonymousLinkType FolderAnonymousLinkType => folderAnonymousLinkType; - - public bool NotifyOwnersWhenItemsReshared => notifyOwnersWhenItemsReshared; - - public bool NotifyOwnersWhenInvitationsAccepted => notifyOwnersWhenInvitationsAccepted; - - public bool NotificationsInOneDriveForBusinessEnabled => notificationsInOneDriveForBusinessEnabled; - - public bool NotificationsInSharePointEnabled => notificationsInSharePointEnabled; - - public SpecialCharactersState SpecialCharactersStateInFileFolderNames => specialCharactersStateInFileFolderNames; - - public bool OwnerAnonymousNotification => ownerAnonymousNotification; - - public bool CommentsOnSitePagesDisabled => commentsOnSitePagesDisabled; - - public bool SocialBarOnSitePagesDisabled => socialBarOnSitePagesDisabled; - - public int OrphanedPersonalSitesRetentionPeriod => orphanedPersonalSitesRetentionPeriod; - - public bool PermissiveBrowserFileHandlingOverride => permissiveBrowserFileHandlingOverride; - - public bool DisallowInfectedFileDownload => disallowInfectedFileDownload; - - public SharingPermissionType DefaultLinkPermission => defaultLinkPermission; - - public SPOConditionalAccessPolicyType ConditionalAccessPolicy => conditionalAccessPolicy; - - public bool AllowDownloadingNonWebViewableFiles => allowDownloadingNonWebViewableFiles; - - public bool AllowEditing => allowEditing; - - public bool ApplyAppEnforcedRestrictionsToAdHocRecipients => applyAppEnforcedRestrictionsToAdHocRecipients; - - public bool FilePickerExternalImageSearchEnabled => filePickerExternalImageSearchEnabled; - - public bool EmailAttestationRequired => emailAttestationRequired; - - public int EmailAttestationReAuthDays => emailAttestationReAuthDays; - - public Guid[] DisabledWebPartIds => disabledWebPartIds; - - public bool DisableCustomAppAuthentication => disableCustomAppAuthentication; - - public SensitiveByDefaultState MarkNewFilesSensitiveByDefault => markNewFilesSensitiveByDefault; - - public bool StopNew2013Workflows => stopNew2013Workflows; - - public bool ViewInFileExplorerEnabled => viewInFileExplorerEnabled; - - public bool DisableSpacesActivation => disableSpacesActivation; - - public bool? AllowFilesWithKeepLabelToBeDeletedSPO => allowFilesWithKeepLabelToBeDeletedSPO; - - public bool? AllowFilesWithKeepLabelToBeDeletedODB => allowFilesWithKeepLabelToBeDeletedODB; - - public bool DisableAddToOneDrive => disableAddToOneDrive; - - public bool IsFluidEnabled => isFluidEnabled; - public bool DisablePersonalListCreation => disablePersonalListCreation; - - public bool ExternalUserExpirationRequired => externalUserExpirationRequired; - - public int ExternalUserExpireInDays => externalUserExpireInDays; - - public bool DisplayNamesOfFileViewers => displayNamesOfFileViewers; - - public bool DisplayNamesOfFileViewersInSpo => displayNamesOfFileViewersInSpo; - public bool IsLoopEnabled => isLoopEnabled; - public Guid[] DisabledModernListTemplateIds => disabledModernListTemplateIds; - public bool RestrictedAccessControl => restrictedAccessControl; - public bool DisableDocumentLibraryDefaultLabeling => disableDocumentLibraryDefaultLabeling; - public bool IsEnableAppAuthPopUpEnabled => isEnableAppAuthPopUpEnabled; - public int? ExpireVersionsAfterDays => expireVersionsAfterDays; - public int? MajorVersionLimit => majorVersionLimit; - public bool? EnableAutoExpirationVersionTrim => enableAutoExpirationVersionTrim; - public bool? EnableAzureADB2BIntegration => enableAzureADB2BIntegration; - public bool? SiteOwnerManageLegacyServicePrincipalEnabled => siteOwnerManageLegacyServicePrincipalEnabled; - - private bool hideDefaultThemes; - - private long storageQuota; - - private long storageQuotaAllocated; - - private double resourceQuota; - - private double resourceQuotaAllocated; - - private long oneDriveStorageQuota; - - private string compatibilityRange; - - private bool externalServicesEnabled; - - private string noAccessRedirectUrl; - - private SharingCapabilities sharingCapability; - - private bool displayStartASiteOption; - - private string startASiteFormUrl; - - private bool showEveryoneClaim; - - private bool showAllUsersClaim; - - private bool officeClientADALDisabled; - - private bool legacyAuthProtocolsEnabled; - - private bool showEveryoneExceptExternalUsersClaim; - - private bool searchResolveExactEmailOrUPN; - - private bool requireAcceptingAccountMatchInvitedAccount; - - private bool provisionSharedWithEveryoneFolder; - - private string signInAccelerationDomain; - - private bool enableGuestSignInAcceleration; - - private bool usePersistentCookiesForExplorerView; - - private bool bccExternalSharingInvitations; - - private string bccExternalSharingInvitationsList; - - private bool userVoiceForFeedbackEnabled; - - private bool publicCdnEnabled; - - private string publicCdnAllowedFileTypes; - - private IList publicCdnOrigins; - - private int requireAnonymousLinksExpireInDays; - - private string sharingAllowedDomainList; - - private string sharingBlockedDomainList; - - private SharingDomainRestrictionModes sharingDomainRestrictionMode; - - private bool oneDriveForGuestsEnabled; - - private bool ipAddressEnforcement; - - private string ipAddressAllowList; - - private int ipAddressWACTokenLifetime; - - private bool useFindPeopleInPeoplePicker; - - private SharingLinkType defaultSharingLinkType; - - private SharingState odbMembersCanShare; - - private SharingState odbAccessRequests; - - private bool preventExternalUsersFromResharing; - - private bool showPeoplePickerSuggestionsForGuestUsers; - - private AnonymousLinkType fileAnonymousLinkType; - - private AnonymousLinkType folderAnonymousLinkType; - - private bool notifyOwnersWhenItemsReshared; - - private bool notifyOwnersWhenInvitationsAccepted; - - private bool notificationsInOneDriveForBusinessEnabled; - - private bool notificationsInSharePointEnabled; - - private SpecialCharactersState specialCharactersStateInFileFolderNames; - - private bool ownerAnonymousNotification; - - private bool commentsOnSitePagesDisabled; - - private bool socialBarOnSitePagesDisabled; - - private int orphanedPersonalSitesRetentionPeriod; - - private bool permissiveBrowserFileHandlingOverride; - - private bool disallowInfectedFileDownload; - - private SharingPermissionType defaultLinkPermission; - - private SPOConditionalAccessPolicyType conditionalAccessPolicy; - - private bool allowDownloadingNonWebViewableFiles = true; - - private bool allowEditing = true; - - private bool applyAppEnforcedRestrictionsToAdHocRecipients; - - private bool filePickerExternalImageSearchEnabled; - - private bool emailAttestationRequired; - - private int emailAttestationReAuthDays; - - private Guid[] disabledWebPartIds; - - private bool disableCustomAppAuthentication; - - private SensitiveByDefaultState markNewFilesSensitiveByDefault; - - private bool stopNew2013Workflows; - - private bool viewInFileExplorerEnabled; - - private bool disableSpacesActivation; - - private bool? allowFilesWithKeepLabelToBeDeletedSPO; - - private bool? allowFilesWithKeepLabelToBeDeletedODB; - - private bool disableAddToOneDrive; - - private bool isFluidEnabled; - - private bool disablePersonalListCreation; - - private Guid[] disabledModernListTemplateIds; - - private bool externalUserExpirationRequired; - - private int externalUserExpireInDays; - - private bool displayNamesOfFileViewers; - - private bool displayNamesOfFileViewersInSpo; - - private bool isLoopEnabled; - - private bool restrictedAccessControl; - - private bool disableDocumentLibraryDefaultLabeling; - - private bool isEnableAppAuthPopUpEnabled; - - private int? expireVersionsAfterDays; - - private int? majorVersionLimit; - - private bool? enableAutoExpirationVersionTrim; - - private bool? enableAzureADB2BIntegration; - - private bool? siteOwnerManageLegacyServicePrincipalEnabled; + CoreRequestFilesLinkEnabled = tenant.CoreRequestFilesLinkEnabled; + CoreRequestFilesLinkExpirationInDays = tenant.CoreRequestFilesLinkExpirationInDays; + OneDriveRequestFilesLinkEnabled = tenant.OneDriveRequestFilesLinkEnabled; + OneDriveRequestFilesLinkExpirationInDays = tenant.OneDriveRequestFilesLinkExpirationInDays; + BusinessConnectivityServiceDisabled = tenant.BusinessConnectivityServiceDisabled; + } } }