Skip to content

Commit

Permalink
Merge pull request #3318 from reshmee011/dev
Browse files Browse the repository at this point in the history
Amended spotenant, set-pnptenant and get-pnptenant to include property SiteOwnerManageLegacyServicePrincipalEnabled
  • Loading branch information
gautamdsheth authored Aug 9, 2023
2 parents b75f554 + 4d916ec commit eaa261b
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
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;
}
}

0 comments on commit eaa261b

Please sign in to comment.