?
Solved

powershell script for exchange

Posted on 2015-02-19
6
Medium Priority
?
313 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 70

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 70

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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
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 70

Accepted Solution

by:
Qlemo earned 2000 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

Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

Auditing domain password hashes is a commonly overlooked but critical requirement to ensuring secure passwords practices are followed. Methods exist to extract hashes directly for a live domain however this article describes a process to extract u…
Check out this step-by-step guide for using the newly updated Experts Exchange mobile app—released on May 30.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Suggested Courses

770 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