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

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
makel2Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Alex GreenProject Systems EngineerCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Alex GreenProject Systems EngineerCommented:
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 /
makel2Author Commented:
Thanks is there any PowerShell command that can be used to confirm what Default Calendar permissions they currently have set at the moment?
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Alex GreenProject Systems EngineerCommented:
$users = get-content C:\temp\users.txt
Foreach ($User in $Users){
get-mailboxfolderpermission -identity $user:\calendar}
makel2Author 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.
Alex GreenProject Systems EngineerCommented:
Oh

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

When you do that, it should work.

Regards

Alex
Alex GreenProject Systems EngineerCommented:
Paste the code into the white box :D
Alex GreenProject Systems EngineerCommented:
Also remove that picture, it contains your domain.
makel2Author 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
Jason CrawfordTransport NinjaCommented:
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
Jason CrawfordTransport NinjaCommented:
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.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.