Skip to content
This repository has been archived by the owner on Jan 19, 2021. It is now read-only.

Commit

Permalink
Implemented check for tenant admin connection type
Browse files Browse the repository at this point in the history
  • Loading branch information
jensotto committed Nov 30, 2019
1 parent ec514a5 commit 35ac0aa
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Commands/Site/SetSite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,16 @@ protected override void ExecuteCmdlet()
if (IsTenantProperty())
{
#if ONPREMISES
//Assume that the current connection is to the tenant administration site
var tenantAdminUrl = ClientContext.Url;
string tenantAdminUrl;
if (!string.IsNullOrEmpty(SPOnlineConnection.CurrentConnection.TenantAdminUrl))
{
tenantAdminUrl = SPOnlineConnection.CurrentConnection.TenantAdminUrl;
}
else if (string.IsNullOrEmpty(Identity))
else if (SPOnlineConnection.CurrentConnection.ConnectionType == Enums.ConnectionType.TenantAdmin)
{
tenantAdminUrl = ClientContext.Url;
}
else
{
throw new InvalidOperationException(Properties.Resources.NoTenantAdminUrlSpecified);
}
Expand Down

0 comments on commit 35ac0aa

Please sign in to comment.