I need to find out how to get a list of our Partner Center customer tenants without access to the Partner Center API as we do not meet the criteria to access it.
We have GDAP relationships with every tenant, as well as an App Registration that has consent with every tenant. Is there a way in the Graph API to access a list of tenants associated with our account? I really only need the Tenant IDs and nothing else.
Note that: It is not possible to get a list of our Partner Center customer tenants without access to the Partner Center API as we do not meet the criteria to access it.
Hence, you must be having access to the Partner Center API. In case if you get access check the below:
Connect to Partner Center, use the below script:
$appId = "ClientID"
$appSecret = ConvertTo-SecureString -String "Secret" -AsPlainText -Force
$tenantId = "TenantID"
$credential = [PSCredential]::new($appId, $appSecret)
$tokenSplat = @{
ApplicationId = $appId
Credential = $credential
Scopes = "https://api.partnercenter.microsoft.com/user_impersonation"
ServicePrincipal = $true
TenantId = $tenantId
UseAuthorizationCode = $true
}
$token = New-PartnerAccessToken @tokenSplat
$token.RefreshToken
Now connect to Partner Center:
$connectSplat = @{
ApplicationId = $appId
Credential = $credential
RefreshToken = $token.RefreshToken
}
Connect-PartnerCenter @connectSplat
As confirmed by you as you have the access there is no way to get access to Partner Center API.
Is there maybe a way to view the tenants that are consented with the app? Shouldn't the Graph API have a way to see that?
To fetch the tenants the multitenant application has consented, you need to be the user of that particular tenant.
Reference:
Azure AD Multi-tenant App - Find what tenant provided admin consent - Stack Overflow by RamaraoAdapa