-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🪲 Inconsistent output for Get-EntraObjectByObjectId #1366
Comments
I am using Microsoft.Entra 1.0.2, and I don't even have Get-EntraObjectByObjectId command. |
@scottm19468, try updating to Microsoft.Entra v1.0.2 and using the new It has a defined alias of |
@stevemutungi, should the moduleMapping.json file[s] be updated to include Get-EntraDirectoryObject and remove Get-EntraObjectByObjectId (or do you still map aliases)? |
|
Thanks for the feedback. However, the result is the same with Get-EntraDirectoryObject. However, I think I have found the issue. In the AzureAD module it was allowing me to look up a role definition via the RoleTemplateID as well as the object ID of the role. See object below. deletedDateTime : So this works: Get-AzureADObjectByObjectId -ObjectIds d2562ede-74db-457e-a7b6-544e236ebb61 But this does not. Get-EntraDirectoryObject -DirectoryObjectIds d2562ede-74db-457e-a7b6-544e236ebb61 However, this does work. Get-EntraDirectoryObject -DirectoryObjectIds 0ac42763-0fdd-43b5-9db7-c5f8cc732f0b So maybe it isn't a bug, but it is a loss of functionality. Thanks! |
Thanks for reporting the bug. Please ensure you've gone through the following checklist before opening an issue:
Microsoft.Entra
orMicrosoft.Entra.Beta
.Describe the bug
When using Get-AzureADObjectByObjectId it returns the expected object. When doing this with Get-EntraObjectByObjectId, it does not return the expected object. In my case, it doesn't return anything.
To Reproduce
Steps to reproduce the behavior:
'returns object'
'returns nothing'
Expected behavior
I expect the Entra command to return the same answer as the AzureAD command does.
Debug Output
⚠ ATTENTION: Be sure to remove any sensitive information that may be in the logs.
Debug Output
Get-EntraObjectByObjectId -ObjectIds 729827e3-9c14-49f7-bb1b-9608f156bbb8 -debug DEBUG: ============================ TRANSFORMATIONS ============================DEBUG: =========================================================================
DEBUG: POST /v1.0/directoryObjects/microsoft.graph.getByIds?$select=* HTTP/1.1
HTTP: graph.microsoft.com
User-Agent: PowerShell/5.1.14393.6343 EntraPowershell/1.0.1 Get-EntraObjectByObjectId
Content-Length: 48
Content-Type: application/json
{"Ids":["729827e3-9c14-49f7-bb1b-9608f156bbb8"]}
DEBUG: POST https://graph.microsoft.com/v1.0/directoryObjects/microsoft.graph.getByIds?$select=*
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Vary: Accept-Encoding
Strict-Transport-Security: max-age=31536000
request-id: e8d5a962-61d4-4823-9525-c3c2b97530f9
client-request-id: 2719b8de-6755-4cdd-9ab6-76cb242c2568
x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"East
US","Slice":"E","Ring":"5","ScaleUnit":"008","RoleInstance":"BL02EPF0001B4CD"}}
x-ms-resource-unit: 3
OData-Version: 4.0
Cache-Control: no-cache
Date: Tue, 18 Feb 2025 19:52:54 GMT
Location: https://graph.microsoft.com/
Content-Encoding: gzip
Content-Type: application/json; odata.metadata=minimal; odata.streaming=true; IEEE754Compatible=false;
charset=utf-8
{"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#directoryObjects(*)","value":[]}
Module Version
ModuleType Version Name
Script 1.0.1 Microsoft.Entra.Authentication
Script 1.0.1 Microsoft.Entra.DirectoryManagement
Script 1.0.1 Microsoft.Entra.Groups
Environment Data
Name Value
PSVersion 5.1.14393.6343
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.6343
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Screenshots
Additional context
The text was updated successfully, but these errors were encountered: