Skip to content

Commit c56d781

Browse files
gautamdshethGautam Sheth
andauthored
Fix #3098 - issue with Get-PnPTenantSyncClientRestriction not showing… (#3099)
* Fix #3098 - issue with Get-PnPTenantSyncClientRestriction not showing values * Update CHANGELOG.md --------- Co-authored-by: Gautam Sheth <gautam.sheth@staffbase.com>
1 parent c63727f commit c56d781

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
3030
- Fixed issue where `Add-PnPSiteCollectionAdmin -PrimarySiteCollectionAdmin <user>` would require owners to be specified as well. [#3035](https://github.com/pnp/powershell/pull/3035)
3131
- Fixed `Get-PnPAzureADGroup` returns only 100 results even if there are more groups present in Azure AD. [#3085](https://github.com/pnp/powershell/pull/3085)
3232
- Fixed `Get-PnPAccessToken` cmdlet to correctly retrieve the access token for the specified resource URL. [#3091](https://github.com/pnp/powershell/pull/3091)
33+
- Fixed issue with `Get-PnPTenantSyncClientRestriction` cmdlet not populating the necessary properties. [#3099](https://github.com/pnp/powershell/pull/3099)
3334

3435
### Changed
3536

src/Commands/Admin/GetTenantSyncClientRestriction.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ public class GetPnPTenantSyncClientRestriction : PnPAdminCmdlet
1010
{
1111
protected override void ExecuteCmdlet()
1212
{
13-
AdminContext.Load(Tenant);
14-
AdminContext.Load(Tenant, t => t.HideDefaultThemes);
13+
AdminContext.Load(Tenant);
1514
AdminContext.ExecuteQueryRetry();
1615
WriteObject(new SPOTenantSyncClientRestriction(Tenant));
1716
}

src/Commands/Admin/RemoveTenantSyncClientRestriction.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ public class RemovePnPTenantSyncClientRestriction : PnPAdminCmdlet
1111
{
1212
protected override void ExecuteCmdlet()
1313
{
14-
this.Tenant.IsUnmanagedSyncClientForTenantRestricted = false;
15-
this.Tenant.BlockMacSync = false;
16-
this.Tenant.ExcludedFileExtensionsForSyncClient = new List<string>();
17-
this.Tenant.OptOutOfGrooveBlock = false;
18-
this.Tenant.OptOutOfGrooveSoftBlock = false;
19-
this.Tenant.DisableReportProblemDialog = false;
14+
Tenant.IsUnmanagedSyncClientForTenantRestricted = false;
15+
Tenant.BlockMacSync = false;
16+
Tenant.ExcludedFileExtensionsForSyncClient = new List<string>();
17+
Tenant.OptOutOfGrooveBlock = false;
18+
Tenant.OptOutOfGrooveSoftBlock = false;
19+
Tenant.DisableReportProblemDialog = false;
2020
AdminContext.ExecuteQueryRetry();
2121
WriteObject(new SPOTenantSyncClientRestriction(Tenant));
2222
}

src/Commands/Model/SPOTenantSyncClientRestriction.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Microsoft.Online.SharePoint.TenantAdministration;
2+
using Microsoft.SharePoint.Client;
23
using System;
34
using System.Collections.Generic;
45

@@ -50,6 +51,7 @@ public class SPOTenantSyncClientRestriction
5051
/// <param name="tenant">Tenant instance to get the properties from to fill this instance</param>
5152
public SPOTenantSyncClientRestriction(Tenant tenant)
5253
{
54+
tenant.EnsureProperties(t => t.IsUnmanagedSyncClientForTenantRestricted, t => t.AllowedDomainListForSyncClient, t => t.BlockMacSync, t => t.ExcludedFileExtensionsForSyncClient, t => t.OptOutOfGrooveBlock, t => t.OptOutOfGrooveSoftBlock, t => t.DisableReportProblemDialog);
5355
AllowedDomainList = new List<Guid>(tenant.AllowedDomainListForSyncClient);
5456
BlockMacSync = tenant.BlockMacSync;
5557
ExcludedFileExtensions = new List<string>(tenant.ExcludedFileExtensionsForSyncClient);

0 commit comments

Comments
 (0)