ht_comp
asked on
Exhcange 2013 Calendar Permissions
Hi,
I need to clear the calendar permissions on all mailboxes, for all users in my 2013 Exchange server. The only 2 that should be remaining is the default user and anonymous. Is there a script to perfom such a task?
For example :
I have a script, that can go through all the mailboxes, but it only deals with the user that I provide. I need it to take all the users, for example from a text file and go through the process with each and every one.
Get-Mailbox | ForEach-Object {Remove-MailboxFolderPermi ssion $_":\Kalender" -User $Allusers -Confirm:$false} -Confirm:$False
Any Ideas?
I need to clear the calendar permissions on all mailboxes, for all users in my 2013 Exchange server. The only 2 that should be remaining is the default user and anonymous. Is there a script to perfom such a task?
For example :
I have a script, that can go through all the mailboxes, but it only deals with the user that I provide. I need it to take all the users, for example from a text file and go through the process with each and every one.
Get-Mailbox | ForEach-Object {Remove-MailboxFolderPermi
Any Ideas?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi,
We tried to modify the script you provided, as it contained some slight errors, but now we are stuck at the last part of the script. The problem is with the $user value, as the user value must be either alias or smtp address but the $user contains Folder Name, User and Access Rights.
The slightly modified script at the moment:
$mailboxes = Get-Mailbox -resultsize unlimited
ForEach($mailbox in $mailboxes) {
$users= get-mailbox $mailbox | % {get-mailboxfolderpermissi on $_":\Kalender"} | ? {$_.user -notlike "Default*" -AND $_.user -notlike "Anony*"}
if ($users -ne $null) {
Foreach ($user in $users) {
get-mailbox $mailbox | % {Remove-MailboxFolderPermi ssion $_":\Kalender" -User $user -Confirm:$false}
}
}
}
And the error message:
Cannot process argument transformation on parameter 'User'. Cannot convert the "Microsoft.Exchange.Manage ment.Store Task
s.MailboxFolderPermission" value of type "Microsoft.Exchange.Manage ment.Store Tasks.Mail boxFolderP ermission" to type "Mi
crosoft.Exchange.Managemen t.StoreTas ks.Mailbox FolderUser IdParamete r".
+ CategoryInfo : InvalidData: (:) [Remove-MailboxFolderPermi ssion], ParameterBindin...mationEx ception
+ FullyQualifiedErrorId : ParameterArgumentTransform ationError ,Remove-Ma ilboxFolde rPermissio n
We tried to modify the script you provided, as it contained some slight errors, but now we are stuck at the last part of the script. The problem is with the $user value, as the user value must be either alias or smtp address but the $user contains Folder Name, User and Access Rights.
The slightly modified script at the moment:
$mailboxes = Get-Mailbox -resultsize unlimited
ForEach($mailbox in $mailboxes) {
$users= get-mailbox $mailbox | % {get-mailboxfolderpermissi
if ($users -ne $null) {
Foreach ($user in $users) {
get-mailbox $mailbox | % {Remove-MailboxFolderPermi
}
}
}
And the error message:
Cannot process argument transformation on parameter 'User'. Cannot convert the "Microsoft.Exchange.Manage
s.MailboxFolderPermission"
crosoft.Exchange.Managemen
+ CategoryInfo : InvalidData: (:) [Remove-MailboxFolderPermi
+ FullyQualifiedErrorId : ParameterArgumentTransform
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Great solution - With the little modifications it worked very well.
You would need to enumerate the permissions first using get-mailboxfolderpermissio
Closest I can get is the example at the end of this blog posting:
http://careexchange.in/working-with-calendar-permissions-in-bulk-on-exchange-2010-sp2/
Simon.