locked
Giving calendar perms to an entire OU RRS feed

  • Question

  • Good Morning,

    I'm trying to set reviewer access rights to a Mailbox's Calendar for all users within an OU

    I will freely admit to cannibalising the below script from another thread (

    http://social.technet.microsoft.com/Forums/sv-SE/exchangesvradmin/thread/9b321b71-6426-49f9-b60d-7df676039f05 )

    From limited knowledge this should work but I am getting "Select-Object : Property "Alias" cannot be found." in PS

     
    Get-User -OrganizationalUnit "OU=<OU NAME>,DC=DOMAIN,DC=LOCAL"  |select -expand alias |foreach-object{Set-MailboxFolderPermission -identity $($_ + ':\Calendar') -User "<USERNAME>" -AccessRights "Reviewer"}

    Any help is greatly appreciated.

    Regards

    Paddy Maxson

    Thursday, April 19, 2012 9:10 AM

Answers

  • Lets follow the simple steps to achieve this.

    First run the command

    Get-User -OrganizationalUnit "OU=<OU NAME>,DC=DOMAIN,DC=LOCAL"  | select-Object Samaccountname  | Export-Csv C:\Users.csv

    Now open up the users.csv and remove the first line which would be some Type....

    Now run the command

    Import-csv C:\users.csv | foreach-object {Set-MailboxFolderPermission -identity $_Samaccountname":\Calendar" -User "user" -AccessRights "Reviewer"}

    This i have tried above steps in my lab and it worked. Let me know if you find any difficulties.

    Get-User -OrganizationalUnit "OU=<OU NAME>,DC=DOMAIN,DC=LOCAL"  | select-Object Samaccountname | foreach-object{Set-MailboxFolderPermission -identity $_Samaccountname":\Calendar" -User "user" -AccessRights "Reviewer"}

    Above command also worked in my lab but i got the error for few mailboxes.



    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Hasnain Shaikh| My blogs: http://messagingserversupport.com

    Thursday, April 19, 2012 12:18 PM

All replies

  • Can you please try this

    Get-User -OrganizationalUnit "OU=<OU NAME>,DC=DOMAIN,DC=LOCAL"  | select-Object Samaccountname | foreach-object{Set-MailboxFolderPermission -identity $($_ + ':\Calendar') -User "user" -AccessRights "Reviewer"}


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Hasnain Shaikh| My blogs: http://messagingserversupport.com

    Thursday, April 19, 2012 9:27 AM
  • Thank you for your previous reply

    I got a new error:

    ForEach-Object : Method invocation failed because [System.Management.Automation.PSObject] doesn't contain a method named 'op_Addition'.

    Thursday, April 19, 2012 10:26 AM
  • Lets follow the simple steps to achieve this.

    First run the command

    Get-User -OrganizationalUnit "OU=<OU NAME>,DC=DOMAIN,DC=LOCAL"  | select-Object Samaccountname  | Export-Csv C:\Users.csv

    Now open up the users.csv and remove the first line which would be some Type....

    Now run the command

    Import-csv C:\users.csv | foreach-object {Set-MailboxFolderPermission -identity $_Samaccountname":\Calendar" -User "user" -AccessRights "Reviewer"}

    This i have tried above steps in my lab and it worked. Let me know if you find any difficulties.

    Get-User -OrganizationalUnit "OU=<OU NAME>,DC=DOMAIN,DC=LOCAL"  | select-Object Samaccountname | foreach-object{Set-MailboxFolderPermission -identity $_Samaccountname":\Calendar" -User "user" -AccessRights "Reviewer"}

    Above command also worked in my lab but i got the error for few mailboxes.



    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Hasnain Shaikh| My blogs: http://messagingserversupport.com

    Thursday, April 19, 2012 12:18 PM