Skip to content

Commit

Permalink
Updated spo-tenant with additional tenant settings (#3930)
Browse files Browse the repository at this point in the history
  • Loading branch information
reshmee011 authored May 4, 2024
1 parent e3365bb commit feba329
Show file tree
Hide file tree
Showing 3 changed files with 313 additions and 7 deletions.
187 changes: 187 additions & 0 deletions documentation/Set-PnPTenant.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,17 @@ Set-PnPTenant [-SpecialCharactersStateInFileFolderNames <SpecialCharactersState>
[-BusinessConnectivityServiceDisabled <Boolean>]
[-EnableSensitivityLabelForPDF <Boolean>]
[-IsDataAccessInCardDesignerEnabled <Boolean>]
[-CoreSharingCapability <SharingCapabilities>]
[-EnableVersionExpirationSetting <Boolean>]
[-BlockUserInfoVisibilityInOneDrive <TenantBrowseUserInfoPolicyValue>]
[-AllowOverrideForBlockUserInfoVisibility <Boolean>]
[-AllowEveryoneExceptExternalUsersClaimInPrivateSite <Boolean>]
[-AIBuilderEnabled <Boolean>]
[-AllowSensitivityLabelOnRecords <Boolean>]
[-AnyoneLinkTrackUsers <Boolean>]
[-EnableSiteArchive <Boolean>]
[-ESignatureEnabled <Boolean>]
[-BlockUserInfoVisibilityInSharePoint <TenantBrowseUserInfoPolicyValue>]
[-Force] [-Connection <PnPConnection>]
```

Expand Down Expand Up @@ -2370,6 +2381,182 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -CoreSharingCapability
Sets what level of sharing is available for SharePoint sites (not including OneDrive sites).

```yaml
Type: SharingCapabilities
Parameter Sets: (All)
Accepted values: Disabled, ExternalUserSharingOnly, ExternalUserAndGuestSharing, ExistingExternalUserSharingOnly
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -EnableVersionExpirationSetting
Sets intelligent version deleting options and default organization limits.

```yaml
Type: Boolean
Parameter Sets: (All)
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -BlockUserInfoVisibilityInOneDrive
Blocks users from accessing User Info if they have Limited Access permission only to the OneDrive. The policy applies to all OneDrives in the organization.

The valid values are:

ApplyToNoUsers (default) - No users are prevented from accessing User Info when they have Limited Access permission only.
ApplyToAllUsers - All users (internal or external) are prevented from accessing User Info if they have Limited Access permission only.
ApplyToGuestAndExternalUsers - Only external or guest users are prevented from accessing User Info if they have Limited Access permission only.
ApplyToInternalUsers - Only internal users are prevented from accessing User Info if they have Limited Access permission only.

```yaml
Type: TenantBrowseUserInfoPolicyValue
Parameter Sets: (All)
Accepted values: ApplyToNoUsers (default), ApplyToAllUsers, ApplyToGuestAndExternalUsers, ApplyToInternalUsers
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```


### -BlockUserInfoVisibilityInSharePoint
Blocks users from accessing User Info if they have Limited Access permission only to a SharePoint site. The policy applies to all SharePoint sites in the organization.

The valid values are:

ApplyToNoUsers (default) - No users are prevented from accessing User Info when they have Limited Access permission only to a SharePoint site.

ApplyToAllUsers - All users (internal or external) are prevented from accessing User Info if they have Limited Access permission only to a SharePoint site.

ApplyToGuestAndExternalUsers - Only external or guest users are prevented from accessing User Info if they have Limited Access permission only to a SharePoint site.

ApplyToInternalUsers - Only internal users are prevented from accessing User Info if they have Limited Access permission only to a SharePoint site.

```yaml
Type: Boolean
Parameter Sets: (All)
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -AllowOverrideForBlockUserInfoVisibility
Allow organization level policy for Block User Info Visibility to be overridden for a SharePoint site or OneDrive.

The valid values are:

False (default) - Do not allow the Block User Info Visibility policy to be overridden for a SharePoint site or OneDrive.

True - Allow the Block User Info Visibility policy to be overridden for a SharePoint site or OneDrive.

```yaml
Type: Boolean
Parameter Sets: (All)
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -AllowEveryoneExceptExternalUsersClaimInPrivateSite
When this parameter is true, the "Everyone except external users" claim is available in the People Picker of a private site. Set it to false to disable this feature.

The valid values are:

True - The "Everyone except external users" claim is available in People Picker of a private site.
False (default) - The "Everyone except external users" claim is not available in People Picker of a private site.

```yaml
Type: Boolean
Parameter Sets: (All)
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -AIBuilderEnabled
Enables or disables AI Builder.

```yaml
Type: Boolean
Parameter Sets: (All)
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -AllowSensitivityLabelOnRecords
Allows sensitivity label on records.

```yaml
Type: Boolean
Parameter Sets: (All)
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -AnyoneLinkTrackUsers
Enables or disables tracking of users with anyone link.

```yaml
Type: Boolean
Parameter Sets: (All)
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -EnableSiteArchive
Enables or disables site archive.

```yaml
Type: Boolean
Parameter Sets: (All)
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -ESignatureEnabled
Enables or disables eSignature.

```yaml
Type: Boolean
Parameter Sets: (All)
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Force
If provided, no confirmation will be requested and the action will be performed

Expand Down
94 changes: 88 additions & 6 deletions src/Commands/Admin/SetTenant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,39 @@ public class SetTenant : PnPAdminCmdlet
[Parameter(Mandatory = false)]
public bool? DelayDenyAddAndCustomizePagesEnforcement;

[Parameter(Mandatory = false)]
public SharingCapabilities? CoreSharingCapability;

[Parameter(Mandatory = false)]
public bool? EnableVersionExpirationSetting;

[Parameter(Mandatory = false)]
public TenantBrowseUserInfoPolicyValue? BlockUserInfoVisibilityInOneDrive;

[Parameter(Mandatory = false)]
public bool? AllowOverrideForBlockUserInfoVisibility;

[Parameter(Mandatory = false)]
public bool? AllowEveryoneExceptExternalUsersClaimInPrivateSite;

[Parameter(Mandatory = false)]
public bool? AIBuilderEnabled;

[Parameter(Mandatory = false)]
public bool? AllowSensitivityLabelOnRecords;

[Parameter(Mandatory = false)]
public bool? AnyoneLinkTrackUsers;

[Parameter(Mandatory = false)]
public bool? EnableSiteArchive;

[Parameter(Mandatory = false)]
public bool? ESignatureEnabled;

[Parameter(Mandatory = false)]
public TenantBrowseUserInfoPolicyValue? BlockUserInfoVisibilityInSharePoint;

protected override void ExecuteCmdlet()
{
AdminContext.Load(Tenant);
Expand Down Expand Up @@ -460,7 +493,6 @@ protected override void ExecuteCmdlet()
}
if (SharingCapability != null)
{

Tenant.SharingCapability = SharingCapability.Value;
modified = true;
}
Expand Down Expand Up @@ -526,13 +558,11 @@ protected override void ExecuteCmdlet()
modified = true;
}
}

if (DisableBackToClassic.HasValue)
{
Tenant.DisableBackToClassic = DisableBackToClassic.Value;
modified = true;
}

if (UsePersistentCookiesForExplorerView.HasValue)
{
Tenant.UsePersistentCookiesForExplorerView = UsePersistentCookiesForExplorerView.Value;
Expand Down Expand Up @@ -775,8 +805,6 @@ protected override void ExecuteCmdlet()
{
throw new InvalidOperationException("Setting the property DefaultSharingLinkType is not supported by your version of the service");
}


}
if (ODBMembersCanShare.HasValue)
{
Expand Down Expand Up @@ -1389,7 +1417,61 @@ protected override void ExecuteCmdlet()
Tenant.DelayDenyAddAndCustomizePagesEnforcement = DelayDenyAddAndCustomizePagesEnforcement.Value;
modified = true;
}

if (CoreSharingCapability.HasValue)
{
Tenant.CoreSharingCapability = CoreSharingCapability.Value;
modified = true;
}
if (EnableVersionExpirationSetting.HasValue)
{
Tenant.EnableVersionExpirationSetting = EnableVersionExpirationSetting.Value;
modified = true;
}
if (BlockUserInfoVisibilityInOneDrive.HasValue)
{
Tenant.BlockUserInfoVisibilityInOneDrive = BlockUserInfoVisibilityInOneDrive.Value;
modified = true;
}
if (BlockUserInfoVisibilityInSharePoint.HasValue)
{
Tenant.BlockUserInfoVisibilityInSharePoint = BlockUserInfoVisibilityInSharePoint.Value;
modified = true;
}
if (AllowEveryoneExceptExternalUsersClaimInPrivateSite.HasValue)
{
Tenant.AllowEveryoneExceptExternalUsersClaimInPrivateSite = AllowEveryoneExceptExternalUsersClaimInPrivateSite.Value;
modified = true;
}
if (AIBuilderEnabled.HasValue)
{
Tenant.AIBuilderEnabled = AIBuilderEnabled.Value;
modified = true;
}
if (AllowSensitivityLabelOnRecords.HasValue)
{
Tenant.AllowSensitivityLabelOnRecords = AllowSensitivityLabelOnRecords.Value;
modified = true;
}
if (AnyoneLinkTrackUsers.HasValue)
{
Tenant.AnyoneLinkTrackUsers = AnyoneLinkTrackUsers.Value;
modified = true;
}
if (EnableSiteArchive.HasValue)
{
Tenant.EnableSiteArchive = EnableSiteArchive.Value;
modified = true;
}
if (ESignatureEnabled.HasValue)
{
Tenant.ESignatureEnabled = ESignatureEnabled.Value;
modified = true;
}
if (AllowOverrideForBlockUserInfoVisibility.HasValue)
{
Tenant.AllowOverrideForBlockUserInfoVisibility = AllowOverrideForBlockUserInfoVisibility.Value;
modified = true;
}
if (BlockDownloadFileTypePolicy.HasValue)
{
if (!BlockDownloadFileTypePolicy.Value)
Expand Down
39 changes: 38 additions & 1 deletion src/Commands/Model/SPOTenant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Management.Automation;
using InformationBarriersMode = PnP.PowerShell.Commands.Enums.InformationBarriersMode;

namespace PnP.PowerShell.Commands.Model
Expand Down Expand Up @@ -191,9 +192,32 @@ public class SPOTenant
public bool? InformationBarriersSuspension { private set; get; }

public bool? IBImplicitGroupBased { private set; get; }

public bool? AppBypassInformationBarriers { private set; get; }

public InformationBarriersMode? DefaultOneDriveInformationBarrierMode { private set; get; }
public InformationBarriersMode? DefaultOneDriveInformationBarrierMode { private set; get; }

public SharingCapabilities? CoreSharingCapability { private set; get; }

public bool? EnableVersionExpirationSetting { private set; get; }

public TenantBrowseUserInfoPolicyValue? BlockUserInfoVisibilityInOneDrive { private set; get; }

public bool? AllowOverrideForBlockUserInfoVisibility { private set; get; }

public bool? AllowEveryoneExceptExternalUsersClaimInPrivateSite { private set; get; }

public bool? AIBuilderEnabled { private set; get; }

public bool? AllowSensitivityLabelOnRecords { private set; get; }

public bool? AnyoneLinkTrackUsers { private set; get; }

public bool? EnableSiteArchive { private set; get; }

public bool? ESignatureEnabled { private set; get; }

public TenantBrowseUserInfoPolicyValue? BlockUserInfoVisibilityInSharePoint { private set; get; }

#endregion

Expand Down Expand Up @@ -709,6 +733,19 @@ public SPOTenant(Tenant tenant, ClientContext clientContext)
catch
{
}

CoreSharingCapability = tenant.CoreSharingCapability;
EnableVersionExpirationSetting = tenant.EnableVersionExpirationSetting;
BlockUserInfoVisibilityInOneDrive = tenant.BlockUserInfoVisibilityInOneDrive;
AllowOverrideForBlockUserInfoVisibility = tenant.AllowOverrideForBlockUserInfoVisibility;
AllowEveryoneExceptExternalUsersClaimInPrivateSite = tenant.AllowEveryoneExceptExternalUsersClaimInPrivateSite;
AllowSensitivityLabelOnRecords = tenant.AllowSensitivityLabelOnRecords;
AnyoneLinkTrackUsers = tenant.AnyoneLinkTrackUsers;
AIBuilderEnabled = tenant.AIBuilderEnabled;
EnableSiteArchive = tenant.EnableSiteArchive;
ESignatureEnabled = tenant.ESignatureEnabled;
BlockUserInfoVisibilityInSharePoint = tenant.BlockUserInfoVisibilityInSharePoint;

}
}
}

0 comments on commit feba329

Please sign in to comment.