You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 22, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Jul 22, 2024. It is now read-only.
Can't Manage Customer Tenants via Powershell. #417
So we run a script for monthly reporting via powershell for all our customers. The report pulls out all licensed users, and what licenses the customer tenant has. This has been working for ages, but all access via powershell has stopped on the 1st of November. ( I have been passed from Partner support to Azure to 365 and the last engineer informed me I need to come here)
We can still fully manage all customers via the Partner portal and Lighthouse, but powershell access has been revoked.
When running our script we just get " access denied "
Here is the script Connect-MsolService $customers = Get-MsolPartnerContract -All Write-Host "Found $($customers.Count) customers for $((Get-MsolCompanyInformation).displayname)." -ForegroundColor DarkGreen $CSVpath = "C:\Temp\UserLicenseReportOctober.csv" foreach ($customer in $customers) { Write-Host "Retrieving license info for $($customer.name)" -ForegroundColor Green $licensedUsers = Get-MsolUser -TenantId $customer.TenantId -All | Where-Object {$_.islicensed } foreach ($user in $licensedUsers) { Write-Host "$($user.displayname)" -ForegroundColor Yellow $licenses = $user.Licenses $licenseArray = $licenses | foreach-Object {$_.AccountSkuId} $licenseString = $licenseArray -join ", " Write-Host "$($user.displayname) has $licenseString" -ForegroundColor Blue $licensedSharedMailboxProperties = [pscustomobject][ordered]@{ CustomerName = $customer.Name DisplayName = $user.DisplayName Licenses = $licenseString } $licensedSharedMailboxProperties | Export-CSV -Pat h $CSVpath -Append -NoTypeInformation } }
Using Microsoft Graph requires you to setup an App Registration. Something worth noting is that DAP allowed for partner managed app registrations to be preconsented. With GDAP this feature is not available anymore so if you want to setup an app registration in your partner tenant to connect through to your customers they must manually consent to the app registration in their tenant (source).
Activity
mprentice22153 commentedon Nov 9, 2023
The msol and azuread cmdlets no longer work. They were only compatible with DAP and not GDAP. Time to move to using Graph and/or APIs.
itwguthub commentedon Nov 9, 2023
boo, have you pulled any reports using graph on tenants?
Hazeeed commentedon Dec 8, 2023
Hi - did you ever setup graphs or find an alternative to this?
itwguthub commentedon Dec 13, 2023
no - not yet
claw0ry commentedon Jan 12, 2024
You can look at this page to find the equivalent cmdlet's for MS Graph: https://learn.microsoft.com/en-us/powershell/microsoftgraph/azuread-msoline-cmdlet-map?view=graph-powershell-1.0
Using Microsoft Graph requires you to setup an App Registration. Something worth noting is that DAP allowed for partner managed app registrations to be preconsented. With GDAP this feature is not available anymore so if you want to setup an app registration in your partner tenant to connect through to your customers they must manually consent to the app registration in their tenant (source).