Hi Guys,
I would like to change the default sharing policy for mailboxes (in office365) from input from a CSV file. This is because the default policy is not set automatically.(Can't wait for Microsoft to come with a solution). I wrote the following script to accomplish this goal.
$list = Import-Csv ".\names.csv"
foreach($entry in $list) {
$User = $entry.User
Get-Mailbox -Identity $User | Get-MailboxFolderStatistics | Where {$_.Foldertype -ilike "calendar"} | set-MailboxFolderPermission -User Default -Accessrights limiteddetails }
Error message:
The specified mailbox "test\Calendar" doesn't exist.
+ CategoryInfo : NotSpecified: ( : ) [set-MailboxFolderPermission], ManagementObjectNotFoundException
+ FullyQualifiedErrorId : [server=A*********,RequestId=4*****-9ded-4099-b**b-ab5eba451caa,TimeStamp=13-11-2014 22:33:30] [FailureCategory=Cmdlet-ManagementObjectNotFoundException]
510441E8,Microsoft.Exchange.Management.StoreTasks.SetMailboxFolderPermission
+ PSComputerName : pod*******h.outlook.com
It says that the calendar doesn't excist. this is because it should be "test:\calendar" and not "test\calendar"
The reason i put "Where {$_.Foldertype -ilike "calendar"} " in the script is bacause not all calendar folders are named the same.
My questions is how can i add the ":" in front of the calendar.
I'm pretty new to powershell so i hope this is an easy 1 for you guys:)
My csv looks like this:
user
test
test2
test3
Any Help appreciated!
Regards,
DJ