Help with powershell to grant users rights to their own mailboxes

We're having this strange issue where a few users have lost rights to their own mailboxes.  

We just finished migrating from Exchange 5.5 using Quest's tools and there were some serious issues with the old 5.5 sites and domain.  I'm thinking that the users or rights may never have been created properly.

I'd like to create a script that would reapply full permissions for each user to their mailbox, just to be sure it's been done.  If I still have a problem, then I can further troubleshoot.

I know I can do it via powershell, but don't want to run 1000 lines to get everyone.

Any simple trick out there?
odddballAsked:
Who is Participating?
 
BSonPoshConnect With a Mentor Commented:
Hmmm... Lets see. I dont have access to Exchange 2007 environment atm, but perhaps this will work for you

foreach($mailbox in Get-mailbox)
{
    Add-MailboxPermission $mailbox.Identity -AccessRights FullAccess -user $mailbox.name
}
0
 
odddballAuthor Commented:
Thanks for the info.  That looks pretty good but it's for Exchange 2003.  Not sure it will work for 2007.


0
Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

 
BSonPoshCommented:
Add-MailboxPermission <mailbox> -AccessRights FullAccess -user <user>

How would you like to provide the user name and mailbox to the script?
0
 
odddballAuthor Commented:
BSonPosh,

Thanks for the response.  How to provide the username and mailbox information to the script is my challenge.

I'm trying to use get-mailbox or get-mailboxpermission and pipe that output to the add-mailboxpermission, but it isn't working.


0
 
odddballAuthor Commented:
Beautiful!

Thanks so much.  I've not used foreach yet and was having trouble getting it right.
0
 
BSonPoshCommented:
NP... You can do this on one line as well if you perfer

Get-mailbox | %{Add-MailboxPermission $_.Identity -AccessRights FullAccess -user $_.name}
0
All Courses

From novice to tech pro — start learning today.