New-MailboxSearch for all items creates confirmation prompt

I've tried these two variations of the New-MailboxSearch command, but create a prompt I can't seem to suppress.

Try1:

New-365MailboxSearch-Name$iphName-SourceMailboxes$DisabledMailbox.PrimarySMTPAddress -InPlaceHoldEnabled$true-ItemHoldPeriodUnlimited-EstimateOnly-Confirm:$false

Try2:

New-365MailboxSearch -Name $iphName -SourceMailboxes $DisabledMailbox.PrimarySMTPAddress -InPlaceHoldEnabled $true -ItemHoldPeriod Unlimited -EstimateOnly -Confirm: $false -Force

Error:

An empty search will return all items in the source mailbox. If you don't want to copy all the items from the source mailbox, specify additional parameters to narrow the search.

Any thoughts?

June 5th, 2015 8:49pm

Hi,

Please post the entire script for us to help you.

And try to use the following command to specific value of Name and SourceMailboxes parameter.

New-MailboxSearch Name Test SourceMailboxes User@domain.com InPlaceHoldEnabled $true ItemHoldPeriod Unlimited EstimateOnly -Confirm:$false

Best Regards.

Free Windows Admin Tool Kit Click here and download it now
June 9th, 2015 3:48am

Thanks for the reply, but it's not the name that's the problem.  When I try to put a mailbox into In Place Hold with no search parameters, I can't suppress the prompt that says:

"An empty search will return all items in the source mailbox. If you don't want to copy all the items from the source mailbox, specify additional parameters to narrow the search."

I get this with -confirm:$false and -force making it not possible to automate as the prompt requires human intervention.

June 13th, 2015 9:51am

You're trying to put this in a script?  Have you tried putting a "Y" by itself on the next line?
Free Windows Admin Tool Kit Click here and download it now
June 13th, 2015 12:48pm

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

Other recent topics Other recent topics