mattclarified
asked on
Set calendar permissions using Attributes in Exchange 2010 Powershell
Hi
I have recently set all the attributes for our company within AD, and want to set the calendar permissions for all users within one department to be able to access each others calendars.
eg.
If Department Attribute = "HR"
set calendar permissions for HR group to Full
Any help is appreciated
M@
I have recently set all the attributes for our company within AD, and want to set the calendar permissions for all users within one department to be able to access each others calendars.
eg.
If Department Attribute = "HR"
set calendar permissions for HR group to Full
Any help is appreciated
M@
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
A bit more optimised solution is below. The main difference between Chris' solution and mine, is that my works also in an international environment, where the folder Calendar has name in a different language.
$group = "yourdomain\HR"
$mbxs = Get-User -RecipientTypeDetails usermailbox -Filter {department -eq "HR"} | Get-Mailbox
$mbxs | %{
$folder = $_ | Get-MailboxFolderStatistics -FolderScope calendar | Select-Object -ExpandProperty name
Add-MailboxFolderPermission -Identity "$($_.PrimarySMTPAddress):\$folder" -AccessRights owner -User $group}
ASKER
Thanks for your input both, I have run the following which seems to change the permissions on my calendar but not on any others in the group
get-user -filter { Department -eq "Department" } -RecipientType UserMailbox | ForEach-Object {
Set-MailboxFolderPermissio n "$($_.PrimarySmtpAddress): \Calendar" -User manager@company.com -AccessRights Reviewer }
I am testing it with one user getting access first before I start using groups, any ideas?
Thanks
M@
get-user -filter { Department -eq "Department" } -RecipientType UserMailbox | ForEach-Object {
Set-MailboxFolderPermissio
I am testing it with one user getting access first before I start using groups, any ideas?
Thanks
M@
Is this returning the right number of users?
get-user -filter { Department -eq "Department" } -RecipientType UserMailbox
I think you'll want Add- instead of Set- for the permission as well. I think Set- will only modify the right if it's already there.
Chris
get-user -filter { Department -eq "Department" } -RecipientType UserMailbox
I think you'll want Add- instead of Set- for the permission as well. I think Set- will only modify the right if it's already there.
Chris
ASKER
Thanks Chris, running the above command lists all the users within the specific Department. I tried using add and it says that the permission already exists, it still seems to me that its trying to set it on my own account over and over.
M@
M@
ASKER
soos, when i try to run your version it returns
A parameter cannot be found that matches parameter name 'Identity'.
M@
A parameter cannot be found that matches parameter name 'Identity'.
M@
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Thanks soos, took it exactly as you had written it there, think it may have been because i was chopping your expert work up, should of listened to you in the first place!
Some points for Chris too for helping
Thanks for your help!
M@
Some points for Chris too for helping
Thanks for your help!
M@
Open in new window