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?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

odddballAuthor Commented:
Thanks for the info.  That looks pretty good but it's for Exchange 2003.  Not sure it will work for 2007.

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

How would you like to provide the user name and mailbox to the script?
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.

odddballAuthor Commented:

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.

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 $

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
odddballAuthor Commented:

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

Get-mailbox | %{Add-MailboxPermission $_.Identity -AccessRights FullAccess -user $}
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.