Forum Discussion
Missing Search-Mailbox Command in my imported session
- Apr 25, 2017
You need to be a member of one of the following Roles:
[21:18:56][O365]# Get-ManagementRole -Cmdlet Search-Mailbox
Name RoleType
---- --------
Mailbox Import Export MailboxImportExport
Mailbox Search MailboxSearchAdd yourself, reload the cmdlets and you should be good to go.
Use Search-Malbox with care btw, one typo and you're updating your CV... :)
You need to be a member of one of the following Roles:
[21:18:56][O365]# Get-ManagementRole -Cmdlet Search-Mailbox
Name RoleType
---- --------
Mailbox Import Export MailboxImportExport
Mailbox Search MailboxSearch
Add yourself, reload the cmdlets and you should be good to go.
Use Search-Malbox with care btw, one typo and you're updating your CV... :)
VasilMichev wrote:You need to be a member of one of the following Roles:
[21:18:56][O365]# Get-ManagementRole -Cmdlet Search-Mailbox
Name RoleType
---- --------
Mailbox Import Export MailboxImportExport
Mailbox Search MailboxSearch
Add yourself, reload the cmdlets and you should be good to go.
Use Search-Malbox with care btw, one typo and you're updating your CV... :)
VasilMichev thanks for the advice. I started reading through the technet PS documentation yesterday. Then I realised yesterday I got a colleague to add me to the Discovery managment Group.
I had initially tested with a new session and the commandlet wasn't apparent. Having retested and I now have my Search-mailbox commandlet ( which is why I marked this thread as answered) . .However, things are not so simple ..........
Get-Mailbox -ResultSize unlimited | Search-Mailbox -SearchQuery {Subject:"Wy I need to update my CV*"}
The target mailbox or .pst file path is required.
+ CategoryInfo : InvalidArgument: (:) [], ArgumentException
+ FullyQualifiedErrorId : [Server=HE1PR0501MB2716,RequestId=a57a686e-e78b-4bb5-9685-dfc3fe05f276,TimeSt
amp=26/04/2017 14:38:35] [FailureCategory=Cmdlet-ArgumentException] 8C2A5F3A
+ PSComputerName : outlook.office365.com
Rightly or wrongly I assumed that maybe I needed to have delegated permissions for each mailbox - can I undo this if this isn't necessary
Get-Mailbox -ResultSize unlimited -Filter {(RecipientTypeDetails -eq 'UserMailbox')} | Add-MailboxPermission -User darth.vader@deathstar.onmicrosoft.com -AccessRights FullAccess -InheritanceType all
However, I still don't get passed the error shown above.