Skip to content

Commit

Permalink
resolved issue with primary domain not filling in in user templates
Browse files Browse the repository at this point in the history
  • Loading branch information
KelvinTegelaar committed Nov 1, 2021
1 parent 71f355e commit 2461940
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ListUsers/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ param($Request, $TriggerMetadata)
$APIName = $TriggerMetadata.FunctionName
Log-Request -user $request.headers.'x-ms-client-principal' -API $APINAME -message "Accessed this API" -Sev "Debug"

$selectlist = "id", "accountEnabled", "businessPhones", "city", "createdDateTime", "companyName", "country", "department", "displayName", "faxNumber", "givenName", "isResourceAccount", "jobTitle", "mail", "mailNickname", "mobilePhone", "onPremisesDistinguishedName", "officeLocation", "onPremisesLastSyncDateTime", "otherMails", "postalCode", "preferredDataLocation", "preferredLanguage", "proxyAddresses", "showInAddressList", "state", "streetAddress", "surname", "usageLocation", "userPrincipalName", "userType", "assignedLicenses", "onPremisesSyncEnabled", "LicJoined", "Aliasses"
$selectlist = "id", "accountEnabled", "businessPhones", "city", "createdDateTime", "companyName", "country", "department", "displayName", "faxNumber", "givenName", "isResourceAccount", "jobTitle", "mail", "mailNickname", "mobilePhone", "onPremisesDistinguishedName", "officeLocation", "onPremisesLastSyncDateTime", "otherMails", "postalCode", "preferredDataLocation", "preferredLanguage", "proxyAddresses", "showInAddressList", "state", "streetAddress", "surname", "usageLocation", "userPrincipalName", "userType", "assignedLicenses", "onPremisesSyncEnabled", "LicJoined", "Aliasses", "primDomain"

# Write to the Azure Functions log stream.
Write-Host "PowerShell HTTP trigger function processed a request."
Expand All @@ -19,6 +19,7 @@ $GraphRequest = New-GraphGetRequest -uri "https://graph.microsoft.com/beta/users
$_.Aliasses = $_.Proxyaddresses -join ", "
$SkuID = $_.AssignedLicenses.skuid
$_.LicJoined = ($ConvertTable | Where-Object { $_.guid -in $skuid }).'Product_Display_Name' -join ", "
$_.primDomain = ($_.userPrincipalName -split '@' | Select-Object -Last 1)
$_
}

Expand Down

0 comments on commit 2461940

Please sign in to comment.