You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Returns: Get-MgUserMailFolder: Parameter set cannot be resolved using the specified named parameters. One or more parameters issued cannot be used together or an insufficient number of parameters were provided.
Describe the bug
using
Get-MgUserMailFolder -MailFolderId $FolderId -UserId $UserId -All
Returns: Get-MgUserMailFolder: Parameter set cannot be resolved using the specified named parameters. One or more parameters issued cannot be used together or an insufficient number of parameters were provided.
-All is a valid parameter per https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.mail/get-mgusermailfoldermessage?view=graph-powershell-1.0 and has worked in previous versions of the SDK
Using
Get-MgUserMailFolder -MailFolderId $FolderId -UserId $UserId
returns a single object
d ChildFolderCount DisplayName IsHidden ParentF
olderId
AAMkADAzNzBmMzU0LTI3NTItNDQzNy04NzhkLWNmMGU1MzEwYThkNAAuAAAAAAB_7ILpFNx8TrktaK8VYWerAQBe9CuwLc2fTK7W46L1SAp9AABSsNguAAA= 0 Audits False AAMkAD…
Despite the fact that there are many other objects in the folder, as proven by running
$uri = ("https://graph.microsoft.com/v1.0/users/{0}/mailfolders/{1}/Messages/?`$top=999" -f $UserId, $Folderid)
$Data = Invoke-MgGraphRequest -Method get -Uri $Uri
$Data.value.count
999
Expected behavior
Running Get-MgUserMailFolder -MailFolderId $FolderId -UserId $UserId -All should return all messages in a folder.
How to reproduce
See above steps
SDK Version
SDK V2.19
Latest version known to work for scenario above?
In the past - probably V2.13
Known Workarounds
Use the Graph API request.
Debug output
DEBUG: [CmdletBeginProcessing]: - Get-MgUserMailFolder begin processing with parameterSet 'Get'.
DEBUG: [Authentication]: - AuthType: 'AppOnly', TokenCredentialType: 'ClientCertificate', ContextScope: 'Process', AppName: 'Mailbox Reporting App'.
DEBUG: [Authentication]: - Scopes: [User.Read.All, Mail.Read].
DEBUG: ============================ HTTP REQUEST ============================
HTTP Method:
GET
Absolute Uri:
https://graph.microsoft.com/v1.0/users/eff4cd58-1bb8-4899-94de-795f656b4a18/mailFolders/AAMkADAzNzBmMzU0LTI3NTItNDQzNy04NzhkLWNmMGU1MzEwYThkNAAuAAAAAAB_7ILpFNx8TrktaK8VYWerAQBe9CuwLc2fTK7W46L1SAp9AABSsNguAAA%3D
Headers:
FeatureFlag : 00000043
Cache-Control : no-store, no-cache
User-Agent : Mozilla/5.0,(Windows NT 10.0; Microsoft Windows 10.0.22631; en-IE),PowerShell/7.4.2
Accept-Encoding : gzip
SdkVersion : graph-powershell/2.19.0
client-request-id : 48a3cfbd-290c-40ba-99ea-99b16fcc2cb9
Body:
DEBUG: ============================ HTTP RESPONSE ============================
Status Code:
OK
Headers:
Cache-Control : private
Strict-Transport-Security : max-age=31536000
request-id : 478c9497-4ed1-4b2e-bb79-d3660f7f5efa
client-request-id : 48a3cfbd-290c-40ba-99ea-99b16fcc2cb9
x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"North Europe","Slice":"E","Ring":"4","ScaleUnit":"009","RoleInstance":"DU2PEPF00026065"}}
Date : Sun, 02 Jun 2024 21:15:51 GMT
Body:
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('eff4cd58-1bb8-4899-94de-795f656b4a18')/mailFolders/$entity",
"id": "AAMkADAzNzBmMzU0LTI3NTItNDQzNy04NzhkLWNmMGU1MzEwYThkNAAuAAAAAAB_7ILpFNx8TrktaK8VYWerAQBe9CuwLc2fTK7W46L1SAp9AABSsNguAAA=",
"displayName": "Audits",
"parentFolderId": "AAMkADAzNzBmMzU0LTI3NTItNDQzNy04NzhkLWNmMGU1MzEwYThkNAAuAAAAAAB_7ILpFNx8TrktaK8VYWerAQBe9CuwLc2fTK7W46L1SAp9AAAA2lIQAAA=",
"childFolderCount": 0,
"unreadItemCount": 0,
"totalItemCount": 23576,
"sizeInBytes": 152787469,
"isHidden": false
}
DEBUG: [CmdletEndProcessing]: - Get-MgUserMailFolder end processing.
Id ChildFolderCount DisplayName IsHidden ParentF
olderId
AAMkADAzNzBmMzU0LTI3NTItNDQzNy04NzhkLWNmMGU1MzEwYThkNAAuAAAAAAB_7ILpFNx8TrktaK8VYWerAQBe9CuwLc2fTK7W46L1SAp9AABSsNguAAA= 0 Audits False AAMkAD…
Configuration
$psversiontable
Name Value
PSVersion 7.4.2
PSEdition Core
GitCommitId 7.4.2
OS Microsoft Windows 10.0.22631
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Other information
No response
The text was updated successfully, but these errors were encountered: