Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions src/Commands/Admin/SetTenant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,17 @@ public class SetTenant : PnPSharePointOnlineAdminCmdlet
[Parameter(Mandatory = false)]
public string WhoCanShareAllowListInTenant { set; get; }

/// <summary>
/// Principal identities allowed to share content at the tenant level.
/// </summary>
/// <example>
/// <code>
/// Set-Tenant -WhoCanShareAllowListInTenantByPrincipalIdentity @("c:0-.f|rolemanager|spo-grid-all-users/****")
/// </code>
/// </example>
[Parameter(Mandatory = false)]
public string[] WhoCanShareAllowListInTenantByPrincipalIdentity { set; get; }

[Parameter(Mandatory = false)]
public bool? LegacyBrowserAuthProtocolsEnabled { set; get; }

Expand Down Expand Up @@ -1880,6 +1891,23 @@ protected override void ExecuteCmdlet()
}
modified = true;
}


if (WhoCanShareAllowListInTenantByPrincipalIdentity != null)
{
var hasValidValue = WhoCanShareAllowListInTenantByPrincipalIdentity.Any(x => !string.IsNullOrEmpty(x));

if (hasValidValue)
{
Tenant.WhoCanShareAllowListInTenantByPrincipalIdentity = WhoCanShareAllowListInTenantByPrincipalIdentity;
}
else
{
Tenant.WhoCanShareAllowListInTenantByPrincipalIdentity = Array.Empty<string>();
}
modified = true;
}

if (DelayContentSecurityPolicyEnforcement.HasValue)
{
Tenant.DelayContentSecurityPolicyEnforcement = DelayContentSecurityPolicyEnforcement.Value;
Expand Down
5 changes: 5 additions & 0 deletions src/Commands/Model/SPOTenant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,11 @@ public class SPOTenant

public string WhoCanShareAllowListInTenant { private set; get; }

/// <summary>
/// Gets: a list of PrincipalNames Example output: List of PrincipalNames. e.g. ["c:0-.f|rolemanager|contoso-all-users/35533f7d-4536-4c82-9dbc-352f9424578b"]
/// </summary>
public IList<string> WhoCanShareAllowListInTenantByPrincipalIdentity { private set; get; }

public bool? ExtendPermissionsToUnprotectedFiles { private set; get; }

public bool? LegacyBrowserAuthProtocolsEnabled { private set; get; }
Expand Down