diff --git a/documentation/Get-PnPTenantInfo.md b/documentation/Get-PnPTenantInfo.md index dcdb9dbd5..62bb1a653 100644 --- a/documentation/Get-PnPTenantInfo.md +++ b/documentation/Get-PnPTenantInfo.md @@ -12,6 +12,9 @@ online version: https://pnp.github.io/powershell/cmdlets/Get-PnPTenantInfo.html ## SYNOPSIS Gets information about any tenant +** Required Permissions ** +Graph: CrossTenantInformation.ReadBasic.All + ## SYNTAX ### Current Tenant (default) diff --git a/src/Commands/Admin/GetTenantInfo.cs b/src/Commands/Admin/GetTenantInfo.cs index fd60a6ce0..d9ae9e6c3 100644 --- a/src/Commands/Admin/GetTenantInfo.cs +++ b/src/Commands/Admin/GetTenantInfo.cs @@ -1,4 +1,5 @@ using Microsoft.SharePoint.Client; +using PnP.PowerShell.Commands.Attributes; using PnP.PowerShell.Commands.Base; using PnP.PowerShell.Commands.Utilities.REST; using System; @@ -7,6 +8,7 @@ namespace PnP.PowerShell.Commands.Admin { [Cmdlet(VerbsCommon.Get, "PnPTenantInfo")] + [RequiredApiDelegatedOrApplicationPermissions("graph/CrossTenantInformation.ReadBasic.All")] [OutputType(typeof(Model.TenantInfo))] public class GetTenantInfo : PnPAdminCmdlet { @@ -35,13 +37,13 @@ protected override void ExecuteCmdlet() var requestUrl = BuildRequestUrl(); WriteVerbose($"Making call to {requestUrl} to request tenant information"); - var results = RestHelper.Get(Connection.HttpClient, requestUrl, graphAccessToken); + var results = GraphHelper.Get(this, Connection, requestUrl, graphAccessToken); WriteObject(results, true); } private string BuildRequestUrl() { - var baseUrl = $"https://{Connection.GraphEndPoint}/v1.0/tenantRelationships/"; + var baseUrl = $"/v1.0/tenantRelationships/"; var query = string.Empty; switch (ParameterSetName) {