Exchange 2010 powershell script not working

Posted on 2014-09-30
Medium Priority
Last Modified: 2014-09-30

I have the following script which is asking to confirm each and every time it removes the permissions

Import-csv C:\Temp\aliaslist.csv | Foreach {Get-Mailbox -identity $_.Alias | Remove-MailboxPermission -User wsht.local\svc.qmm -AccessRights FullAccess -InheritanceType All}

Open in new window

I've added a -confirm: $false after inheritancetype all and that still doesn't work. How do I stop prompting and automatically accept?


Question by:Alex Green
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment

Accepted Solution

Acosta Technology Services earned 2000 total points
ID: 40352007
You can set confirm preference to"none".

$ConfirmPreference = 'None'

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
How to resolve IMCEAEX NDRs in Exchange or Exchange Online related to invalid X500 addresses.
To show how to generate a certificate request in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Servers >> Certificates‚Ķ
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Suggested Courses

764 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