-
Notifications
You must be signed in to change notification settings - Fork 200
Description
Describe the bug
After connecting with Connect-MgGraph via the latest version of Microsoft.Graph; I am attempting to query for all External users in my instance, and retrieve specific values that are shown if a Select-Object * is performed.
However, multiple values, despite having information present in these fields within Entra are returned empty.
Fields with populated values returned as empty or null include:
- AgeGroup
- City
- CompanyName
- Country
- CreatedDateTime
- PostalCode
- PreferredDataLocation
- Sponsors
- State
- StreetAddress
- UsageLocation
Reviewing documentation for Get-MgUser, I cannot find any indication that this information shouldn't be returned.
Connect-MgGraph has been run at the highest possible privledge scope ("User.ReadWrite.All", "Directory.ReadWrite.All"), however this does not change the outcome.
Expected behavior
The values for Sponsor, and Email would be shown in the result
How to reproduce
- Connect-MgGraph -Scopes "User.ReadWrite.All", "Directory.ReadWrite.All"
- Get-MgUser -Filter "userType eq 'Guest' and accountEnabled eq true" -All | Select-Object *
SDK Version
2.27.0
Latest version known to work for scenario above?
None known
Known Workarounds
None found or known
Debug output
Click to expand log
```DEBUG: [CmdletBeginProcessing]: - Get-MgUser begin processing with parameterSet 'List'.
DEBUG: [Authentication]: - AuthType: 'Delegated', TokenCredentialType: 'InteractiveBrowser', ContextScope: 'CurrentUser', AppName: 'Microsoft Graph Comma
nd Line Tools'.
DEBUG: [Authentication]: - Scopes: [Device.ReadWrite.All, DeviceManagementManagedDevices.ReadWrite.All, DeviceManagementServiceConfig.ReadWrite.All, Dire
ctory.Read.All, Domain.ReadWrite.All, Group.ReadWrite.All, GroupMember.ReadWrite.All, openid, Organization.Read.All, profile, User.Read.All, email, User.
ReadWrite.All, Directory.ReadWrite.All].
DEBUG: ============================ HTTP REQUEST ============================
HTTP Method:
GET
Absolute Uri:
https://graph.microsoft.com/v1.0/users?$filter=userType eq 'Guest' and accountEnabled eq true
Headers:
FeatureFlag : 00000003
Cache-Control : no-store, no-cache
User-Agent : Mozilla/5.0,(Windows NT 10.0; Microsoft Windows 10.0.26120; en-AU),PowerShell/5.1.26100.3863
SdkVersion : graph-powershell/2.27.0
client-request-id : c663abea-670f-4129-a5cd-670e58295e22
Body:
DEBUG: ============================ HTTP RESPONSE ============================
Status Code:
OK
Headers:
Transfer-Encoding : chunked
Vary : Accept-Encoding
Strict-Transport-Security : max-age=31536000
request-id : 4857e33d-478d-486a-80d3-f960e5fa4b8c
client-request-id : c663abea-670f-4129-a5cd-670e58295e22
x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"Australia Southeast","Slice":"E","Ring":"3","ScaleUnit":"000","RoleInstance":"ML1PEPF00006B8
C"}}
x-ms-resource-unit : 2
OData-Version : 4.0
Cache-Control : no-cache
Date : Tue, 06 May 2025 12:24:58 GMT
Body:
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users",
"value": [
{
"businessPhones": [
"--redacted--"
],
"displayName": "--redacted--",
"givenName": "--redacted--",
"jobTitle": "--redacted--",
"mail": "--redacted--",
"mobilePhone": "--redacted--",
"officeLocation": null,
"preferredLanguage": null,
"surname": "--redacted--",
"userPrincipalName": "--redacted--",
"id": "--redacted--"
}
]
}
AboutMe :
AccountEnabled :
Activities :
AgeGroup :
AgreementAcceptances :
AppRoleAssignments :
AssignedLicenses :
AssignedPlans :
Authentication : Microsoft.Graph.PowerShell.Models.MicrosoftGraphAuthentication
AuthorizationInfo : Microsoft.Graph.PowerShell.Models.MicrosoftGraphAuthorizationInfo
Birthday :
BusinessPhones : --redacted--
Calendar : Microsoft.Graph.PowerShell.Models.MicrosoftGraphCalendar
CalendarGroups :
CalendarView :
Calendars :
Chats :
City :
CloudClipboard : Microsoft.Graph.PowerShell.Models.MicrosoftGraphCloudClipboardRoot
CompanyName :
ConsentProvidedForMinor :
ContactFolders :
Contacts :
Country :
CreatedDateTime :
CreatedObjects :
CreationType :
CustomSecurityAttributes : Microsoft.Graph.PowerShell.Models.MicrosoftGraphCustomSecurityAttributeValue
DeletedDateTime :
Department :
DeviceEnrollmentLimit :
DeviceManagementTroubleshootingEvents :
DirectReports :
DisplayName : --redacted--
Drive : Microsoft.Graph.PowerShell.Models.MicrosoftGraphDrive
Drives :
EmployeeExperience : Microsoft.Graph.PowerShell.Models.MicrosoftGraphEmployeeExperienceUser
EmployeeHireDate :
EmployeeId :
EmployeeLeaveDateTime :
EmployeeOrgData : Microsoft.Graph.PowerShell.Models.MicrosoftGraphEmployeeOrgData
EmployeeType :
Events :
Extensions :
ExternalUserState :
ExternalUserStateChangeDateTime :
FaxNumber :
FollowedSites :
GivenName : --redacted--
HireDate :
Id : --redacted--
Identities :
ImAddresses :
InferenceClassification : Microsoft.Graph.PowerShell.Models.MicrosoftGraphInferenceClassification
Insights : Microsoft.Graph.PowerShell.Models.MicrosoftGraphItemInsights
Interests :
IsManagementRestricted :
IsResourceAccount :
JobTitle : --redacted--
JoinedTeams :
LastPasswordChangeDateTime :
LegalAgeGroupClassification :
LicenseAssignmentStates :
LicenseDetails :
Mail : --redacted--
MailFolders :
MailNickname :
MailboxSettings : Microsoft.Graph.PowerShell.Models.MicrosoftGraphMailboxSettings
ManagedAppRegistrations :
ManagedDevices :
Manager : Microsoft.Graph.PowerShell.Models.MicrosoftGraphDirectoryObject
MemberOf :
Messages :
MobilePhone : --redacted--
MySite :
Oauth2PermissionGrants :
OfficeLocation :
OnPremisesDistinguishedName :
OnPremisesDomainName :
OnPremisesExtensionAttributes : Microsoft.Graph.PowerShell.Models.MicrosoftGraphOnPremisesExtensionAttributes
OnPremisesImmutableId :
OnPremisesLastSyncDateTime :
OnPremisesProvisioningErrors :
OnPremisesSamAccountName :
OnPremisesSecurityIdentifier :
OnPremisesSyncEnabled :
OnPremisesUserPrincipalName :
Onenote : Microsoft.Graph.PowerShell.Models.MicrosoftGraphOnenote
OnlineMeetings :
OtherMails :
Outlook : Microsoft.Graph.PowerShell.Models.MicrosoftGraphOutlookUser
OwnedDevices :
OwnedObjects :
PasswordPolicies :
PasswordProfile : Microsoft.Graph.PowerShell.Models.MicrosoftGraphPasswordProfile
PastProjects :
People :
PermissionGrants :
Photo : Microsoft.Graph.PowerShell.Models.MicrosoftGraphProfilePhoto
Photos :
Planner : Microsoft.Graph.PowerShell.Models.MicrosoftGraphPlannerUser
PostalCode :
PreferredDataLocation :
PreferredLanguage :
PreferredName :
Presence : Microsoft.Graph.PowerShell.Models.MicrosoftGraphPresence
Print : Microsoft.Graph.PowerShell.Models.MicrosoftGraphUserPrint
ProvisionedPlans :
ProxyAddresses :
RegisteredDevices :
Responsibilities :
Schools :
ScopedRoleMemberOf :
SecurityIdentifier :
ServiceProvisioningErrors :
Settings : Microsoft.Graph.PowerShell.Models.MicrosoftGraphUserSettings
ShowInAddressList :
SignInActivity : Microsoft.Graph.PowerShell.Models.MicrosoftGraphSignInActivity
SignInSessionsValidFromDateTime :
Skills :
Solutions : Microsoft.Graph.PowerShell.Models.MicrosoftGraphUserSolutionRoot
Sponsors :
State :
StreetAddress :
Surname : --redacted--
Teamwork : Microsoft.Graph.PowerShell.Models.MicrosoftGraphUserTeamwork
Todo : Microsoft.Graph.PowerShell.Models.MicrosoftGraphTodo
TransitiveMemberOf :
UsageLocation :
UserPrincipalName : --redacted--
UserType :
AdditionalProperties : {}
DEBUG: [CmdletEndProcessing]: - Get-MgUser end processing.
</details>
### Configuration
- OS: Windows 11 Pro 24H2 26120.3863
- Architecture: x64
Name Value
---- -----
PSVersion 5.1.26100.3863
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.26100.3863
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
### Other information
_No response_