Search code examples
powershellexchange-server-2010

Powershell - Exchange calendar sharing looping through all users


What I would like to do is get a list of all users in exchange and loop through them giving each user full access ("owner") right to every other calendar. So basically I want everyone at the company to have "owner" permission to everyone else.

Here is what I have to far it works fine but I would like this to be automated meaning the "username1" and "username2" to be replaced with active users from my exchange server.

Add-MailboxFolderPermission -Identity "username1":\calendar -user "username2" -AccessRights owner


Solution

  • From my comment on the question.

    You have lots of options but you can use

    Get-Mailbox | ForEach-Object{Add-MailboxFolderPermission -Identity "username1":\calendar -user $_.SamAccountName -AccessRights owner}
    

    This will grab every mailbox, since no filter is applied, and add the MailboxFolderPermission to those mailboxes.

    That should work. Be careful as you are making irreversable changes to everyone.