Suppress Confirm prompt in Set-Mailbox Exchange 2010
I have the need to rehome a large number of mailboxes in Exchange 2010 using a command similar to this one:$db = "MDB32"$mailboxes = Get-Mailbox -Server servername$mailboxes | foreach { Set-Mailbox $_.Name -Database $db }I have tried adding -Confirm:$false to the Set-Mailbox command, however I am asked for confirmation every time anyway.I have also tried setting $ConfirmPreference='None'.Unfortunately these methods have not worked for me. In addition, specifying "Yes to All" via the [A] key does not work either. I really don't want to have to hit the Enter key a few thousand times.Hopefully I am just missing something simple. Any insight would be appreciated.
February 16th, 2010 2:09am

Have you tried the -force switch parameter? I think that should do the trick. $mailboxes | foreach { Set-Mailbox $_.Name -Database $db -force }
Free Windows Admin Tool Kit Click here and download it now
February 16th, 2010 3:40am

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

Other recent topics Other recent topics