Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amended spotenant, set-pnptenant and get-pnptenant to include property SiteOwnerManageLegacyServicePrincipalEnabled #3318

Merged
merged 10 commits into from
Aug 9, 2023
Merged
16 changes: 16 additions & 0 deletions documentation/Set-PnPTenant.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ Set-PnPTenant [-SpecialCharactersStateInFileFolderNames <SpecialCharactersState>
[-StopNew2013Workflows <Boolean>]
[-MediaTranscription <MediaTranscriptionPolicyType>]
[-MediaTranscriptionAutomaticFeatures <MediaTranscriptionAutomaticFeaturesPolicyType>]
[-SiteOwnerManageLegacyServicePrincipalEnabled <Boolean>]
[-Force] [-Connection <PnPConnection>]
```

Expand Down Expand Up @@ -2151,6 +2152,21 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -SiteOwnerManageLegacyServicePrincipalEnabled

This parameter allows site owners to create or update the service principal.

```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
8 changes: 8 additions & 0 deletions src/Commands/Admin/SetTenant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,8 @@ public class SetTenant : PnPAdminCmdlet
[Parameter(Mandatory = false)]
public MediaTranscriptionAutomaticFeaturesPolicyType? MediaTranscriptionAutomaticFeatures { get; set; }

[Parameter(Mandatory = false)]
public bool? SiteOwnerManageLegacyServicePrincipalEnabled { get; set; }
protected override void ExecuteCmdlet()
{
AdminContext.Load(Tenant);
Expand Down Expand Up @@ -1266,6 +1268,12 @@ protected override void ExecuteCmdlet()
modified = true;
}

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

if (BlockDownloadFileTypePolicy.HasValue)
{
if (!BlockDownloadFileTypePolicy.Value)
Expand Down
14 changes: 13 additions & 1 deletion src/Commands/Model/SPOTenant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public SPOTenant(Tenant tenant, ClientContext clientContext)
this.displayNamesOfFileViewersInSpo = tenant.DisplayNamesOfFileViewersInSpo;
this.isLoopEnabled = tenant.IsLoopEnabled;
this.enableAzureADB2BIntegration = tenant.EnableAzureADB2BIntegration;
this.siteOwnerManageLegacyServicePrincipalEnabled = tenant.SiteOwnerManageLegacyServicePrincipalEnabled;

try
{
Expand Down Expand Up @@ -461,7 +462,15 @@ public SPOTenant(Tenant tenant, ClientContext clientContext)
}
catch
{
}
}

try
{
this.siteOwnerManageLegacyServicePrincipalEnabled = tenant.SiteOwnerManageLegacyServicePrincipalEnabled;
}
catch
{
}
}

public bool HideDefaultThemes => hideDefaultThemes;
Expand Down Expand Up @@ -630,6 +639,7 @@ public SPOTenant(Tenant tenant, ClientContext clientContext)
public int? MajorVersionLimit => majorVersionLimit;
public bool? EnableAutoExpirationVersionTrim => enableAutoExpirationVersionTrim;
public bool? EnableAzureADB2BIntegration => enableAzureADB2BIntegration;
public bool? SiteOwnerManageLegacyServicePrincipalEnabled => siteOwnerManageLegacyServicePrincipalEnabled;

private bool hideDefaultThemes;

Expand Down Expand Up @@ -808,5 +818,7 @@ public SPOTenant(Tenant tenant, ClientContext clientContext)
private bool? enableAutoExpirationVersionTrim;

private bool? enableAzureADB2BIntegration;

private bool? siteOwnerManageLegacyServicePrincipalEnabled;
}
}
Loading