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?
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.


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

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

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
BSonPoshCommented:
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

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:
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
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
Exchange

From novice to tech pro — start learning today.