Link to home
Start Free TrialLog in
Avatar of Robguad
Robguad

asked on

Import-csv remove-mailbox - how to choose [a] yes to all in the syntax of the command?

Here is the syntax of the command I am using
Import-Csv recipients.csv | foreach {Remove-Mailbox -identity $_.Identity}

This command works, but i have to choose yes for every single line and there are 1200 mailboxes I am removing.
I get this response for every mailbox in the script

Confirm
Are you sure you want to perform this action?
Removing the Mailbox "<domain>\<username>" will remove the Windows user object and
 mark the mailbox in the database for removal.
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help
(default is "Y"):A

Choosing A only applies to that single mailbox, not the whole string.

Is there a way to add a command to have it select A for Yes to all for the whole string of mailboxes?
ASKER CERTIFIED SOLUTION
Avatar of Haddion
Haddion
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial