Need to be able to query CompanyProfile Email
See original GitHub issueWe 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:
/// <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:
- Created 5 years ago
- Comments:17 (10 by maintainers)
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.
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.