diff --git a/documentation/Rename-PnPTenantSite.md b/documentation/Rename-PnPTenantSite.md index 625fdf294..9d26159fd 100644 --- a/documentation/Rename-PnPTenantSite.md +++ b/documentation/Rename-PnPTenantSite.md @@ -135,6 +135,20 @@ Accept pipeline input: True Accept wildcard characters: False ``` +### -SuppressAdminUrlValidation +Suppress validating the Tenant Admin URL. Useful if your tenant has a vanity domain or an otherwise non-standard admin site address. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) + +Required: False +Position: Named +Default value: None +Accept pipeline input: True +Accept wildcard characters: False +``` + ### -Wait Wait till the renaming of the new site collection is successful. If not specified, a job will be created which you can use to check for its status. diff --git a/src/Commands/Admin/RenameTenantSite.cs b/src/Commands/Admin/RenameTenantSite.cs index 76e3408f5..5ed14c37e 100644 --- a/src/Commands/Admin/RenameTenantSite.cs +++ b/src/Commands/Admin/RenameTenantSite.cs @@ -37,6 +37,9 @@ public class RenameTenantSite : PnPAdminCmdlet [Parameter(Mandatory = false)] public SwitchParameter SuppressBcsCheck { get; set; } + [Parameter(Mandatory = false)] + public SwitchParameter SuppressAdminUrlValidation { get; set; }; + [Parameter(Mandatory = false)] public SwitchParameter Wait { get; set; } @@ -68,7 +71,11 @@ protected override void ExecuteCmdlet() OperationId = Guid.Empty }; - var tenantUrl = UrlUtilities.GetTenantAdministrationUrl(AdminContext.Url); + var tenantUrl = AdminContext.Url; + if (!SuppressAdminUrlValidation) + { + tenantUrl = UrlUtilities.GetTenantAdministrationUrl(AdminContext.Url); + } var results = Utilities.REST.RestHelper.PostAsync(HttpClient, $"{tenantUrl.TrimEnd('/')}/_api/SiteRenameJobs?api-version=1.4.7", AdminContext, body, false).GetAwaiter().GetResult(); if (!Wait.IsPresent)