diff --git a/CHANGELOG.md b/CHANGELOG.md index 741f43dd2..1ac679f9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Added `Unlock-PnPSensitivityLabelEncryptedFile` which allows the encryption to be removed from a file [#3864](https://github.com/pnp/powershell/pull/3864) - Added `Get-PnPLibraryFileVersionBatchDeleteJobStatus` and `Get-PnPSiteFileVersionBatchDeleteJobStatus` to check on the status of applying file based version expiration based on age on a library and site level [#3828](https://github.com/pnp/powershell/pull/3828) - Added support for `Get-PnPSiteCollectionAppCatalog` and `Get-PnPTenantSite` to be used with vanity domain tenants [#3895](https://github.com/pnp/powershell/pull/3895) +- Added support for using vanity domain tenants with `Grant-PnPTenantServicePrincipalPermission`, `Revoke-PnPTenantServicePrincipalPermission`, `Set-PnPWebTheme`, `Invoke-PnPListDesign`, `Set-PnPSite`, `Add-PnPSiteDesignTask`, `Get-PnPSiteDesignRun`, `Get-PnPSiteDesignTask` and `Invoke-PnPSiteDesign` cmdlets [#3898](https://github.com/pnp/powershell/pull/3898) ### Fixed diff --git a/src/Commands/Apps/GrantTenantServicePrincipalPermission.cs b/src/Commands/Apps/GrantTenantServicePrincipalPermission.cs index daf4fecac..1742cedda 100644 --- a/src/Commands/Apps/GrantTenantServicePrincipalPermission.cs +++ b/src/Commands/Apps/GrantTenantServicePrincipalPermission.cs @@ -21,7 +21,7 @@ public class GrantTenantServicePrincipalPermission : PnPGraphCmdlet public string Resource = "Microsoft Graph"; protected override void ExecuteCmdlet() { - var tenantUrl = UrlUtilities.GetTenantAdministrationUrl(ClientContext.Url); + var tenantUrl = Connection.TenantAdminUrl ?? UrlUtilities.GetTenantAdministrationUrl(ClientContext.Url); using (var tenantContext = ClientContext.Clone(tenantUrl)) { var spoWebAppServicePrincipal = new SPOWebAppServicePrincipal(tenantContext); diff --git a/src/Commands/Apps/RevokeTenantServicePrincipalPermission.cs b/src/Commands/Apps/RevokeTenantServicePrincipalPermission.cs index 4659e29d1..97c167e91 100644 --- a/src/Commands/Apps/RevokeTenantServicePrincipalPermission.cs +++ b/src/Commands/Apps/RevokeTenantServicePrincipalPermission.cs @@ -25,8 +25,7 @@ public class RevokeTenantServicePrincipal : PnPGraphCmdlet protected override void ExecuteCmdlet() { - - var tenantUrl = UrlUtilities.GetTenantAdministrationUrl(ClientContext.Url); + var tenantUrl = Connection.TenantAdminUrl ?? UrlUtilities.GetTenantAdministrationUrl(ClientContext.Url); using (var tenantContext = ClientContext.Clone(tenantUrl)) { var spoWebAppServicePrincipal = new SPOWebAppServicePrincipal(tenantContext); diff --git a/src/Commands/Branding/SetWebTheme.cs b/src/Commands/Branding/SetWebTheme.cs index db0f30c33..e23d72502 100644 --- a/src/Commands/Branding/SetWebTheme.cs +++ b/src/Commands/Branding/SetWebTheme.cs @@ -22,7 +22,7 @@ public class SetWebTheme : PnPWebCmdlet protected override void ExecuteCmdlet() { var url = CurrentWeb.EnsureProperty(w => w.Url); - var tenantUrl = UrlUtilities.GetTenantAdministrationUrl(ClientContext.Url); + var tenantUrl = Connection.TenantAdminUrl ?? UrlUtilities.GetTenantAdministrationUrl(ClientContext.Url); using (var tenantContext = ClientContext.Clone(tenantUrl)) { var tenant = new Tenant(tenantContext); diff --git a/src/Commands/ListDesign/InvokeListDesign.cs b/src/Commands/ListDesign/InvokeListDesign.cs index b004ebddf..57cdfa3ce 100644 --- a/src/Commands/ListDesign/InvokeListDesign.cs +++ b/src/Commands/ListDesign/InvokeListDesign.cs @@ -19,7 +19,7 @@ public class InvokeListDesign : PnPWebCmdlet protected override void ExecuteCmdlet() { var url = CurrentWeb.EnsureProperty(w => w.Url); - var tenantUrl = UrlUtilities.GetTenantAdministrationUrl(ClientContext.Url); + var tenantUrl = Connection.TenantAdminUrl ?? UrlUtilities.GetTenantAdministrationUrl(ClientContext.Url); using (var tenantContext = ClientContext.Clone(tenantUrl)) { var tenant = new Tenant(tenantContext); diff --git a/src/Commands/Site/SetSite.cs b/src/Commands/Site/SetSite.cs index 9e6043da0..556c64df7 100644 --- a/src/Commands/Site/SetSite.cs +++ b/src/Commands/Site/SetSite.cs @@ -237,7 +237,7 @@ protected override void ExecuteCmdlet() if (IsTenantProperty()) { - var tenantAdminUrl = UrlUtilities.GetTenantAdministrationUrl(context.Url); + var tenantAdminUrl = Connection.TenantAdminUrl ?? UrlUtilities.GetTenantAdministrationUrl(context.Url); context = context.Clone(tenantAdminUrl); executeQueryRequired = false; diff --git a/src/Commands/SiteDesigns/AddSiteDesignTask.cs b/src/Commands/SiteDesigns/AddSiteDesignTask.cs index 930f6e1c7..8bce3dac1 100644 --- a/src/Commands/SiteDesigns/AddSiteDesignTask.cs +++ b/src/Commands/SiteDesigns/AddSiteDesignTask.cs @@ -19,7 +19,7 @@ public class AddSiteDesignTask : PnPWebCmdlet protected override void ExecuteCmdlet() { var url = CurrentWeb.EnsureProperty(w => w.Url); - var tenantUrl = UrlUtilities.GetTenantAdministrationUrl(ClientContext.Url); + var tenantUrl = Connection.TenantAdminUrl ?? UrlUtilities.GetTenantAdministrationUrl(ClientContext.Url); using (var tenantContext = ClientContext.Clone(tenantUrl)) { var webUrl = url; diff --git a/src/Commands/SiteDesigns/GetSiteDesignRun.cs b/src/Commands/SiteDesigns/GetSiteDesignRun.cs index c667025c2..27a632e26 100644 --- a/src/Commands/SiteDesigns/GetSiteDesignRun.cs +++ b/src/Commands/SiteDesigns/GetSiteDesignRun.cs @@ -19,7 +19,7 @@ public class GetSiteDesignRun : PnPWebCmdlet protected override void ExecuteCmdlet() { var url = CurrentWeb.EnsureProperty(w => w.Url); - var tenantUrl = UrlUtilities.GetTenantAdministrationUrl(ClientContext.Url); + var tenantUrl = Connection.TenantAdminUrl ?? UrlUtilities.GetTenantAdministrationUrl(ClientContext.Url); using (var tenantContext = ClientContext.Clone(tenantUrl)) { var tenant = new Tenant(tenantContext); diff --git a/src/Commands/SiteDesigns/GetSiteDesignTask.cs b/src/Commands/SiteDesigns/GetSiteDesignTask.cs index 0f771b888..372e20dbe 100644 --- a/src/Commands/SiteDesigns/GetSiteDesignTask.cs +++ b/src/Commands/SiteDesigns/GetSiteDesignTask.cs @@ -19,7 +19,7 @@ public class GetSiteDesignTask : PnPWebCmdlet protected override void ExecuteCmdlet() { var url = CurrentWeb.EnsureProperty(w => w.Url); - var tenantUrl = UrlUtilities.GetTenantAdministrationUrl(ClientContext.Url); + var tenantUrl = Connection.TenantAdminUrl ?? UrlUtilities.GetTenantAdministrationUrl(ClientContext.Url); using (var tenantContext = ClientContext.Clone(tenantUrl)) { if (Identity != null) diff --git a/src/Commands/SiteDesigns/InvokeSiteDesign.cs b/src/Commands/SiteDesigns/InvokeSiteDesign.cs index 14caa892e..b77d3cf50 100644 --- a/src/Commands/SiteDesigns/InvokeSiteDesign.cs +++ b/src/Commands/SiteDesigns/InvokeSiteDesign.cs @@ -19,7 +19,7 @@ public class InvokeSiteDesign : PnPWebCmdlet protected override void ExecuteCmdlet() { var url = CurrentWeb.EnsureProperty(w => w.Url); - var tenantUrl = UrlUtilities.GetTenantAdministrationUrl(ClientContext.Url); + var tenantUrl = Connection.TenantAdminUrl ?? UrlUtilities.GetTenantAdministrationUrl(ClientContext.Url); using (var tenantContext = ClientContext.Clone(tenantUrl)) { var tenant = new Tenant(tenantContext);