Need to Set Default Calendar Permissions for users in Exchange Server 2010

makel2
makel2 used Ask the Experts™
on
Hi,

I  need to set default calendar permissions for all users in the New York Office to "Reviewer".  All User Active Directory Objects have the Office attribute populated with the location "New York". Also how do I get a report that show's that this has been changed for the New York users. I'm using Exchange Server 2010 and PowerShell needs to be used
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Senior Infrastructure Analyst
Commented:
First of all get a list of samaccountnames

Get-aduser -filter {(Office -like "New York")} | Select-object Samaccountname | out-file C:\temp\users.txt

Open in new window



$users = get-content C:\temp\users.txt
Foreach ($User in $Users){
set-mailboxfolderpermission -identity $user:/calendar -User Default -AccessRights Reviewer}

Open in new window

AlexSenior Infrastructure Analyst

Commented:
Sorry

$users = get-content C:\temp\users.txt
Foreach ($User in $Users){
set-mailboxfolderpermission -identity $user:\calendar -User Default -AccessRights Reviewer}

It's a \ not a /

Author

Commented:
Thanks is there any PowerShell command that can be used to confirm what Default Calendar permissions they currently have set at the moment?
Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

AlexSenior Infrastructure Analyst
Commented:
$users = get-content C:\temp\users.txt
Foreach ($User in $Users){
get-mailboxfolderpermission -identity $user:\calendar}

Author

Commented:
Hi,

I was able to generate the users.txt using powershell however when I went to set the permissions in Exchange Server 2010 I got the error message attached.
AlexSenior Infrastructure Analyst
Commented:
Oh

What you need to do is launch powershell_ISE.exe rather than powershell

When you do that, it should work.

Regards

Alex
AlexSenior Infrastructure Analyst
Commented:
Paste the code into the white box :D
AlexSenior Infrastructure Analyst
Commented:
Also remove that picture, it contains your domain.

Author

Commented:
Hi,

I tried all that and got the error message attached.

User1
User2
Edit: I correct it but still getting an error message

User3
User4

Commented:
Try this in Exchange Management Shell:

Import-Module activedirectory

foreach ($user in (Get-ADUser -Filter {Office -eq 'New York'})) {
  Set-MailboxFolderPermission "$($user.samaccountname):\calendar" -User Default -AccessRights Reviewer
}

Open in new window

Edit: enclosed "$($user.samaccountname):\calendar" in quotes

Commented:
Note you should not be using PowerShell ISE with this script unless you load the Exchange module first.  You have to use Exchange Management Shell.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial