Solved

powershell script for exchange

Posted on 2015-02-19
6
182 Views
Last Modified: 2015-02-19
Need some help with this

We use exchange online with office 365 I need to verify that a particular user has fullaccess permission on every mailbox.  I can see what mailboxes he has access to with this:

Get-MailBox | Get-MailboxPermission -User "user@domain.com" | export-csv c:\temp\results.csv

What I need however is the opposite, I need to see what mailboxes he doesn't have access to.

Thanks!
0
Comment
Question by:jcneil4
  • 3
  • 3
6 Comments
 
LVL 69

Expert Comment

by:Qlemo
ID: 40619057
This will result in all mailbox objects this particular user does not have access to:
get-mailbox | % { if (Get-MailboxPermission $_ -User user@domain.com) {} else { $_ }}

Open in new window

0
 
LVL 1

Author Comment

by:jcneil4
ID: 40619074
Thanks when I run it returns this error for each:

Cannot process argument transformation on parameter 'Identity'. Cannot convert value "smith, Mike" to type
"Microsoft.Exchange.Configuration.Tasks.MailboxIdParameter". Error: "Cannot convert hashtable to an object of the following type:
Microsoft.Exchange.Configuration.Tasks.MailboxIdParameter. Hashtable-to-Object conversion is not supported in restricted language mode or
a Data section."
    + CategoryInfo          : InvalidData: (:) [Get-MailboxPermission], ParameterBindin...mationException
    + FullyQualifiedErrorId : ParameterArgumentTransformationError,Get-MailboxPermission
    + PSComputerName        : outlook.office365.com
0
 
LVL 69

Expert Comment

by:Qlemo
ID: 40619128
Has to be a O365 issue, because it works with my MSX2007.
Let's try by being more specific:
get-mailbox | % { if (Get-MailboxPermission -Identity $_,Identity -User user@domain.com) {} else { $_ }}

Open in new window

0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 1

Author Comment

by:jcneil4
ID: 40619138
Actually tried that already!  Doesn't work-

new error:

Cannot process argument transformation on parameter 'Identity'. Cannot convert the "System.Collections.ArrayList" value of type
"System.Collections.ArrayList" to type "Microsoft.Exchange.Configuration.Tasks.MailboxIdParameter".
    + CategoryInfo          : InvalidData: (:) [Get-MailboxPermission], ParameterBindin...mationException
    + FullyQualifiedErrorId : ParameterArgumentTransformationError,Get-MailboxPermission
    + PSComputerName        : outlook.office365.com
0
 
LVL 69

Accepted Solution

by:
Qlemo earned 500 total points
ID: 40619181
Sorry, a typo. Needs to be dot instead of comma ...
get-mailbox | % { if (Get-MailboxPermission -Identity $_.Identity -User user@domain.com) {} else { $_ }}

Open in new window

0
 
LVL 1

Author Comment

by:jcneil4
ID: 40619214
You are the man!  Thanks!
0

Featured Post

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
As cyber crime continues to grow in both numbers and sophistication, a troubling trend of optimization has emerged over the last year.
Microsoft Office Picture Manager has a Picture Shortcuts pane that shows a list with the Recently Browsed folders. While creating my video Micro Tutorial here at Experts Exchange showing How to Install Microsoft Office Picture Manager in Office 2013…
This video discusses moving either the default database or any database to a new volume.

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question