Bulk remove mailboxpermission for multiple users on one mailbox
Hi, im removing fullaccess permissions using a powershell script reading a csv file.The csv has the following format :displayName,samAccountName,sPermissions"John Doe",JD00,domain\helpdesk1"Brigitta Buh",BB00,domain\helpdesk1My script :Import-CSV d:\scripts\checks\fullaccess-check.csv | ForEach {Remove-MailboxPermission -Identity " $_.samAccountName "-User " $UserWithFullAccess "-AccessRight FullAccess -InheritanceType All}This works very fine for me, but now there are more helpdesk staff andI face the problem that there are multiple users on the mailbox,my csv looks likeas follow :displayName,samAccountName,sPermissions"John Doe",JD00,domain\helpdesk1%domain\helpdesk2%domain\helpdesk3"Brigitta Buh",BB00,domain\helpdesk1%domain\helpdesk3Maybe I have to convert the csv first to look like this :displayName,samAccountName,sPermissions"John Doe",JD00,domain\helpdesk1"John Doe",JD00,domain\helpdesk2"John Doe",JD00,domain\helpdesk3"Brigitta Buh",BB00,domain\helpdesk1"Brigitta Buh",BB00,domain\helpdesk3Any ideas, thank you
November 4th, 2009 2:03pm

Aslo try this posting under DEVELOPER Section. http://social.technet.microsoft.com/Forums/en-US/exchangesvrdevelopment/threadsVinod |CCNA|MCSE 2003 +Messaging|MCTS|ITIL V3|
Free Windows Admin Tool Kit Click here and download it now
November 4th, 2009 2:15pm

Hi, im removing fullaccess permissions using a powershell script reading a csv file.The csv has the following format :displayName,samAccountName,sPermissions"John Doe",JD00,domain\helpdesk1"Brigitta Buh",BB00,domain\helpdesk1My script :Import-CSV d:\scripts\checks\fullaccess-check.csv | ForEach {Remove-MailboxPermission -Identity " $_.samAccountName "-User " $UserWithFullAccess "-AccessRight FullAccess -InheritanceType All}This works very fine for me, but now there are more helpdesk staff andI face the problem that there are multiple users on the mailbox,my csv looks likeas follow :displayName,samAccountName,sPermissions"John Doe",JD00,domain\helpdesk1%domain\helpdesk2%domain\helpdesk3"Brigitta Buh",BB00,domain\helpdesk1%domain\helpdesk3Maybe I have to convert the csv first to look like this :displayName,samAccountName,sPermissions"John Doe",JD00,domain\helpdesk1"John Doe",JD00,domain\helpdesk2"John Doe",JD00,domain\helpdesk3"Brigitta Buh",BB00,domain\helpdesk1"Brigitta Buh",BB00,domain\helpdesk3Any ideas, thank you Yes, that looks perfect by removing them one by one. Else you may need to write complex script and forwhichyou can get help in Development session...Amit Tank MVP: Exchange Server | MCTS: Microsoft Exchange Server 2010, ConfigurationMCITP: EMA | MCSA: M | Blog: http://ExchangeShare.WordPress.com
November 4th, 2009 2:39pm

Yes, I blogged the same method for achieving this recently. http://exchangeshell.wordpress.com/2009/10/28/how-to-bulk-add-send-as-and-fullaccess-permissions-using-exchange-2007-powershell-using-add-adpermission-and-add-mailboxpermission/Shaun
Free Windows Admin Tool Kit Click here and download it now
November 4th, 2009 3:02pm

Hi, because english is not my motherlanguage, my question was not so clear. So I try it again.all I need ist some suggestions to convert this csv :displayName,samAccountName,sPermissions"John Doe",JD00,domain\helpdesk1%domain\helpdesk2%domain\helpdesk3"Brigitta Buh",BB00,domain\helpdesk1%domain\helpdesk3into this :displayName,samAccountName,sPermissions"John Doe",JD00,domain\helpdesk1"John Doe",JD00,domain\helpdesk2"John Doe",JD00,domain\helpdesk3"Brigitta Buh",BB00,domain\helpdesk1"Brigitta Buh",BB00,domain\helpdesk3Thanks Erwin
November 4th, 2009 3:48pm

The details in my blog should allow what you are trying to achieve with a little amendment. I don't believe you need three columns. Create a CSV with 2 colums. TheMailbox (for thepermissions to be amended) and TheUser (to remove FullAccess permission on) For instance lets say the CSV looks like this and is saved as c:\thelist.csv: TheMailbox,TheUseremp70,emp66emp71,emp67emp72,emp68Run: $Thelist = Import-csv C:\thelist.csvForEach($theobject in $thelist) {$theMBDN = (Get-Mailbox $theobject.themailbox).distinguishedname; Remove-MailboxPermission $theMBDN -Accessrights FullAccess -User $theobject.theuser}Shaun
Free Windows Admin Tool Kit Click here and download it now
November 4th, 2009 5:22pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics