Remove users from exchange mailbox

Posted on 2011-04-28
Medium Priority
Last Modified: 2012-05-11
I am trying to get this script to remove users with send as and full access permission to a certain mailbox. For some reason this is not working and wanted some assistance please.

$i=Get-content "c:\temp\script.txt"

Foreach-Object {

Remove-MailboxPermission -Identity "mailbox" -User $_. -AccessRights FullAccess -whatif

Question by:techdrive
LVL 71

Accepted Solution

Chris Dent earned 2000 total points
ID: 35485822
You want a pipe there:
Get-Content "c:\temp\script.txt" | ForEach-Object {
  Remove-MailboxPermission "mailbox" -User $_ -AccessRights FullAccess -WhatIf

Open in new window

Otherwise there's no way to get from the file list to the loop.

And I guess you know you want Remove-ADPermission to handle Send As?



Author Closing Comment

ID: 35491399
Thanks and as usual you are a genuis

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to effectively resolve the number one email related issue received by helpdesks.
Exchange administrators are always vigilant about Exchange crashes and disasters that are possible any time. It is quite essential to identify the symptoms of a possible Exchange issue and be prepared with a proper recovery plan. There are multiple…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Screencast - Getting to Know the Pipeline
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question