Partner-Center-PowerShell icon indicating copy to clipboard operation
Partner-Center-PowerShell copied to clipboard

How can I get through the Microsoft Partner Center Power Shell to extract the list of clients that have the delegated administration of the tenant and the clients in which I do not have the delegated administration of the tenant?

Open jarquillo opened this issue 3 years ago • 7 comments

Feature Request

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I am always frustrated when [...]

Describe the solution you would like A clear and concise description of what you want to happen.

Describe alternatives you have considered A clear and concise description of any alternative solutions or features you have considered.

Additional context Add any other context or screenshots about the feature request here.

jarquillo avatar Jul 14 '21 16:07 jarquillo

Here's how we do this:

connect-msolservice # Connect as yourself

connect-partnercenter $customers = Get-PartnerCustomer | Sort-Object -Property Name

foreach ($c in $customers) {

try { $null = get-msoldomain -tenantID $c.customerid -erroraction stop } catch { write-output "Unable to connect to $($c.Name) ($($c.customerid))" }

Typed that in by hand so I might be a little off but that will get you close. Any customer that you can't pull the domains for you don't have admin access.

mprentice22153 avatar Jul 14 '21 18:07 mprentice22153

Hello mprentice22153 first of all thank you for the answer. I am trying to put the command "connect-msolservice # Connect as yourself" from the Windows Power Shell and the system gives the following message: "The term 'connect-msolservice' is not recognized as the name of a cmdlet, function, file script or executable program. Check if you typed the name correctly or, if you included a path, Please check that this path is correct and try again. Online: 1 Character: 1

  • connect-msolservice # Connect as yourself
    • CategoryInfo: ObjectNotFound: (connect-msolservice: String) [], CommandNotFoundException
    • FullyQualifiedErrorId: CommandNotFoundException " ¿ Do you know what can happen ?

jarquillo avatar Jul 19 '21 07:07 jarquillo

Google the error and see why it is happening. You will also see that two lines of my response joined into a single line accidentally. I've given you the foundation, you should be able to solve the rest.

mprentice22153 avatar Jul 19 '21 11:07 mprentice22153

Hello mprentice22153 we have already connected with the Partner Center but I do not understand what lines I have to put to extract the client list that the delegated administration has. Can you tell us please?

jarquillo avatar Jul 20 '21 15:07 jarquillo

Can someone help me with the query I have put in please?

jarquillo avatar Jul 22 '21 15:07 jarquillo

This way worked for me:

$PartnerCustomerCompanyProfile = Get-PartnerCustomerCompanyProfile -CustomerId $PartnerCustomer.CustomerId
if (!$PartnerCustomerCompanyProfile.Email) {
    'No permission'
}

ili101 avatar Nov 10 '21 17:11 ili101

I've recently discovered this which I believe is the correct solution: Get-PartnerCustomerManagedService -CustomerId <customerTenantID> |where {$_.GroupName -eq 'Office'} | select Name,ManagedServiceID

This provides the listing of services that can be managed, similar to what is seen in the UX.

A lot of this will change as everything moves towards Granular DAP which is in pilot and coming into Partner Centers soon.

mprentice22153 avatar Nov 17 '21 17:11 mprentice22153