SOLVED

A parameter cannot be found that matches parameter name 'InactiveMailboxOnly'

Copper Contributor

The argument cannot be found after ExchangeOnlineManagement module is updated to 3.3.0

The same behavior after the module is uninstalled/installed.

 

Screenshotmodule.jpg

 

5 Replies

@Olegs Nenasevs 

 

I'm not seeing that, myself:

 

LainRobertson_0-1696313937204.png

 

If you run the following command, do you see "-InactiveMailboxOnly" listed as a parameter?

 

Get-Command -Module tmpexo* -Name Get-Mailbox -Syntax;

 

LainRobertson_1-1696314314662.png

 

Cheers,

Lain

I connected using Connect-ExchangeOnline in PowerShell 5 and 7 using module version 3.3.0, with no issues. It returned nothing, which is correct in my test tenant. (Get-Mailbox returns my mailboxes)

Does Get-EXOMailbox -InactiveMailboxOnly work? (Same but new version cmdlet)
best response confirmed by Olegs Nenasevs (Copper Contributor)
Solution
As others have mentioned, the parameter is available and working fine. Most likely the user you are connecting with does not have the necessary permissions to use said parameter. To find out which role(s) include a given cmdlet/parameter, you can use the following:

# Get-ManagementRole -Cmdlet Get-Mailbox -CmdletParameters InactiveMailboxOnly

Name RoleType
---- --------
Mail Recipient Creation MailRecipientCreation
Mail Recipients MailRecipients
Compliance Admin ComplianceAdmin
Mailbox Search MailboxSearch
View-Only Recipients ViewOnlyRecipients

@VasilMichev 

 

There you go - I learnt something new.

 

I'd only been aware that RBAC impacted which commandlets were exposed, not that it extended down into to the parameters layer.

 

Cheers,

Lain

1 best response

Accepted Solutions
best response confirmed by Olegs Nenasevs (Copper Contributor)
Solution
As others have mentioned, the parameter is available and working fine. Most likely the user you are connecting with does not have the necessary permissions to use said parameter. To find out which role(s) include a given cmdlet/parameter, you can use the following:

# Get-ManagementRole -Cmdlet Get-Mailbox -CmdletParameters InactiveMailboxOnly

Name RoleType
---- --------
Mail Recipient Creation MailRecipientCreation
Mail Recipients MailRecipients
Compliance Admin ComplianceAdmin
Mailbox Search MailboxSearch
View-Only Recipients ViewOnlyRecipients

View solution in original post