Giving calendar perms to an entire OU
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
April 19th, 2012 5:10am
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
Free Windows Admin Tool Kit Click here and download it now
April 19th, 2012 5:27am
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'.
April 19th, 2012 6:26am
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
Free Windows Admin Tool Kit Click here and download it now
April 19th, 2012 8:18am