Skip to content
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

Get-MgDomainNameReference does not return all results #2851

Open
titlerequired opened this issue Jul 16, 2024 · 2 comments
Open

Get-MgDomainNameReference does not return all results #2851

titlerequired opened this issue Jul 16, 2024 · 2 comments
Labels

Comments

@titlerequired
Copy link

Describe the bug

Get-MgDomainNameReference -DomainId $domain.id -All
Returns 300 results by default.
Using page size, you can return 999. However in environments with more recipients the command does not seem to paginate.

Expected behavior

Using -all returns all references in a tenant.

How to reproduce

Get-MgDomainNameReference -DomainId $domain.id -All | measure-object

SDK Version

2.19.0

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output

Debug information is truncated.

Configuration

Name Value


PSVersion 5.1.19041.4648
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.4648
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Other information

No response

@titlerequired titlerequired added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Jul 16, 2024
@titlerequired
Copy link
Author

Work around, using Invoke-RestMethod if you query:
https://graph.microsoft.com/v1.0/domains/<domain id>/domainNameReferences/microsoft.graph.group
or
https://graph.microsoft.com/v1.0/domains/<domain.id>/domainNameReferences/microsoft.graph.user
You can retrieve all results, it is not clear how to do this using Get-MgDomainNameReference as trying to filter on type appears to be unsupported.
"The specified filter to the reference property query is currently not supported."
Get-MgDomainNameReference -Filter "@odata.type eq '#microsoft.graph.user'"

Is there a way to query this using PowerShell?

@titlerequired
Copy link
Author

Invoke-MgGraphRequest < is the way to go. You still need to use a filtered URL, but It returns a @odata.nextLink that you can follow to loop through/paginate.

@timayabi2020 timayabi2020 added Status: Needs Investigation and removed status:waiting-for-triage An issue that is yet to be reviewed or assigned labels Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants