question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Need to be able to query CompanyProfile Email

See original GitHub issue

We used to be able to query registered emial fro Get-PCCustomer and via Get-PCCustomerCompanyProfile -TenantId $($CustomerDetails.id) cmdlets.

New commands do not have equivalent of the latter and the Get-PartnerCustomer does not contain that information. It is extremely important we get that email address as we use it for on-boarding throughout the code,

Get-PCCustomerCompanyProfile -TenantId $($CustomerDetails.id)

tenantId    : x-x-x-x-xxxxxx
domain      : xxxxxonmicrosoft.com
companyName : Default Directory
address     : @{country=GB}
email       : xxxx@gmail.com
links       : @{self=}
attributes  : @{objectType=CustomerCompanyProfile}

Also:

$Customer = Get-PCCustomer -TenantId $($CustomerDetails.id)
$Customer.CompanyProfile.Email
x@gmail.com

And:

$Customer = Get-PCCustomer -TenantId $($CustomerDetails.id)
$Customer
id                    :  x-x-x-x-xxxxx
commerceId            : x-x-x-x-xxxxx
companyProfile        : @{tenantId=x-x-x-x-x; domain=x.onmicrosoft.com; companyName=Default Directory; address=; email=x@gmail.com; links=; attributes=}
billingProfile        : @{id=xxx-xxx-xxx-xxx-xxx ; firstName=xxx-xxx-xxx-974b-xxxx; lastName=xxx-xx-47d8-xx-xx; culture=en-US; language=en; companyName=Default Directory; defaultAddress=; links=; attributes=}
relationshipToPartner : reseller
allowDelegatedAccess  : True
customDomains         : {x.onmicrosoft.com}
links                 : @{self=}
attributes            : @{objectType=Customer}

New commands however only show:

CustomerId                           Domain                                   Name
----------                           ------                                   ----
xx-xx-xx-xx-xxxx x.onmicrosoft.com Default Directory

I know that email is in the billing profile but it is exactly what I want to set as it does not get populated from CompanyProfile automatically when you create new sub. It needs to be added in manually and old code allowed me to do it as it was querying: “https://api.partnercenter.microsoft.com/v1/customers/{0}/profiles/company

Can email field be added please and can we have the new command to query it directly as well?

Not sure if we can just fix it by doing this:

https://github.com/Microsoft/Partner-Center-PowerShell/blob/master/src/PowerShell/Models/Customers/PSCustomer.cs

        /// <summary>
        /// Addtional operations to be performed when cloning an instance of <see cref="Customer" /> to an instance of <see cref="PSCustomer" />. 
        /// </summary>
        /// <param name="customer">The customer being cloned.</param>
        private void CloneAdditionalOperations(Customer customer)
        {
            CustomerId = customer.Id;
            Domain = customer?.CompanyProfile?.Domain;
            Name = customer?.CompanyProfile?.CompanyName;
            Email =  customer?.CompanyProfile?.Email;
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:17 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
ghostcommented, Nov 15, 2018

Hi @cblackuk,

This version of the PowerShell module is using the .NET SDK to request information from the Partner Center API. The address and email properties are not included on the model the SDK is using to deserialize the response from the API. This means the values are going to be omitted. I am actively working on an alternative solution. The hope is to have this solution available next week, but I will not know for sure until I am able to resolve a blocking issue.

1reaction
ghostcommented, Oct 10, 2018

Hi @cblackuk,

My apologizes I completely missed that those fields where missing from the model. I just got them added, and they will be included in the next release of the module. I will double check the other models to make sure nothing else is missing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to write a business inquiry email with examples
Follow these, and every information request will be communicated clearly and effectively. Tailor the message; Explain who you are; Be clear ...
Read more >
How to ask for something in an email with 9 examples
Being able to write a polite and formal email requesting information with a clear purpose is essential in your personal and professional life....
Read more >
How to Write an Email Requesting Something
Before beginning your email, consider who you're writing to and why. Think about your relationship with the person and what tone is appropriate....
Read more >
Best Business Introduction Email Templates That Work ...
Business introduction email template examples from top performers that guarantee a higher response rate. Check out the best intro email ...
Read more >
Business Introduction Email Samples & Templates
3 business introduction email samples and templates to land new clients ... will help you get your company introduction emails to where they...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found