invictus-ir / Microsoft-Extractor-Suite

A PowerShell module for acquisition of data from Microsoft 365 and Azure for Incident Response and Cyber Security purposes.
https://microsoft-365-extractor-suite.readthedocs.io/en/latest/
GNU General Public License v2.0
481 stars 68 forks source link

Show-MailboxRules fails in 2.0.3 #93

Closed Hacks4Packs closed 1 month ago

Hacks4Packs commented 1 month ago

PS C:\Users\XYZ> Show-MailboxRules -UserIds "someone@redacted.com"

[INFO] Checking someone@redacted.com... Get-InboxRule: []\PowerShell\Modules\Microsoft-Extractor-Suite\2.0.3\Scripts\Get-Rules.ps1:153 Line | 153 | $inboxrule = get-inboxrule -Mailbox $UserIds | ~~~~ | A parameter cannot be found that matches parameter name 'Mailbox'.

JoeyInvictus commented 1 month ago

Hi, weird one so get-inboxrule -Mailbox command is used by the Extractor Suite to lookup the mailbox rules. However, it's odd that it’s returning an error stating that the "Mailbox" parameter cannot be found.

image

It seems to be working fine on my end. Could you try running the following command to bypass the Extractor Suite and help identify the underlying issue? (replace the email with one in your domain)

Get-InboxRule -Mailbox Joe@Contoso.com

image

Hacks4Packs commented 1 month ago

Does look like a "me" issue - I'll nuke and rebuild my ExchPowershell install.

PS C:\Users\XYZ> get-inboxrule -Mailbox Bleh@.. Get-InboxRule: A parameter cannot be found that matches parameter name 'Mailbox'.

Get-Help Get-Inboxrule NAME Get-InboxRule SYNOPSIS This cmdlet is available in on-premises Exchange and in the cloud-based service. Some parameters and settings may be exclusive to one environment or the other.

Use the Get-InboxRule cmdlet to view Inbox rule properties. Inbox rules are used to process messages in the Inbox based on conditions specified and take
actions such as moving a message to a specified folder or deleting a message.

For information about the parameter sets in the Syntax section below, see Exchange cmdlet syntax
(https://docs.microsoft.com/powershell/exchange/exchange-cmdlet-syntax).

SYNTAX Get-InboxRule [[-Identity] ] [-BypassScopeCheck] [-DescriptionTimeFormat ] [-DescriptionTimeZone ] [-IncludeHidden] [-Mailbox ] [] <-------?!?!

JoeyInvictus commented 1 month ago

Haha finally it's not me. Let me know if there is anything I can help with.