Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - suppressing confirmation prompt

Reply
 
Old 08-24-2007   #1 (permalink)
Peter Lawton


 
 

suppressing confirmation prompt

I'm having problems running an Exchange shell script automatically because I
can't suppress the confirmation prompt. I've tried asking in an exchange
group but nobody there could help.

The command I'm trying to run is:-

get-mailbox | set-mailbox -Confirm:$False -ManagedFolderMailboxPolicy
"Default Policy"

But I get the prompt:-

Confirm
When assigning a managed folder mailbox policy with managed custom folders
to
the mailbox "domain/Users/username", Outlook clients older than
Outlook 2007 do not have all available client features and clients older
than
Outlook 2003 SP2 are not supported. You may use the "Set-CASMailbox" task to
enable client version blocking. Are you sure you want to assign a managed
folder mailbox policy to this mailbox?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help
(default is "Y"):

I've also tried setting $ConfirmPreference="none" or
$ConfirmPreference="high" but the prompt still appears

Can anyone think of a way to suppress the prompt or automatically answer "A"
so I can run this unnattended?

Many thanks

Peter Lawton




My System SpecsSystem Spec
Old 08-24-2007   #2 (permalink)
Shay Levi


 
 

Re: suppressing confirmation prompt

I recreated your scenario and tried various commands, none helped, including
setting $ConfirmPreference to "none".

Then I tried to make the change through the GUI. The confirm dialog
appears even in the GUI.

I guess the Exchange team refers to this as a significant change, thus you
cant
avoid the dialog.


HTH

Shay
http://scriptolog.blogspot.com



> I'm having problems running an Exchange shell script automatically
> because I can't suppress the confirmation prompt. I've tried asking in
> an exchange group but nobody there could help.
>
> The command I'm trying to run is:-
>
> get-mailbox | set-mailbox -Confirm:$False -ManagedFolderMailboxPolicy
> "Default Policy"
>
> But I get the prompt:-
>
> Confirm
> When assigning a managed folder mailbox policy with managed custom
> folders
> to
> the mailbox "domain/Users/username", Outlook clients older than
> Outlook 2007 do not have all available client features and clients
> older
> than
> Outlook 2003 SP2 are not supported. You may use the "Set-CASMailbox"
> task to
> enable client version blocking. Are you sure you want to assign a
> managed
> folder mailbox policy to this mailbox?
> [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help
> (default is "Y"):
> I've also tried setting $ConfirmPreference="none" or
> $ConfirmPreference="high" but the prompt still appears
>
> Can anyone think of a way to suppress the prompt or automatically
> answer "A" so I can run this unnattended?
>
> Many thanks
>
> Peter Lawton
>



My System SpecsSystem Spec
Old 08-24-2007   #3 (permalink)
Marco Shaw


 
 

Re: suppressing confirmation prompt

Peter Lawton wrote:
> I'm having problems running an Exchange shell script automatically because I
> can't suppress the confirmation prompt. I've tried asking in an exchange
> group but nobody there could help.
>
> The command I'm trying to run is:-
>
> get-mailbox | set-mailbox -Confirm:$False -ManagedFolderMailboxPolicy
> "Default Policy"
>
> But I get the prompt:-
>
> Confirm
> When assigning a managed folder mailbox policy with managed custom folders
> to
> the mailbox "domain/Users/username", Outlook clients older than
> Outlook 2007 do not have all available client features and clients older
> than
> Outlook 2003 SP2 are not supported. You may use the "Set-CASMailbox" task to
> enable client version blocking. Are you sure you want to assign a managed
> folder mailbox policy to this mailbox?
> [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help
> (default is "Y"):
>
> I've also tried setting $ConfirmPreference="none" or
> $ConfirmPreference="high" but the prompt still appears
>
> Can anyone think of a way to suppress the prompt or automatically answer "A"
> so I can run this unnattended?


WScript has some funtionality to send key strokes to the screen:
http://www.devguru.com/Technologies/..._SendKeys.html

Just for fun, I used AutoIt:

PSH>$autoit=new-object -comobject autoitx3.control
PSH>$autoit.send("write-host `"test`"");$autoit.send("{ENTER}")
PSH> write-host "test"
test
PSH>

You could likely write a dynamic script that does a repeated loop and
sends the proper key strokes to the PowerShell console.

That being said, you might want some kind of error control, but you
might just be able to do a start-transcript/stop-transcript and review
the console log to make sure all was well...

Marco


--
----------------
PowerGadgets MVP
http://www.powergadgets.com/mvp

Blog:
http://marcoshaw.blogspot.com
My System SpecsSystem Spec
Old 08-24-2007   #4 (permalink)
Peter Lawton


 
 

Re: suppressing confirmation prompt

I was afraid of that it's an Exchange team "feature", my suspicion is that
when they created the custom warning about versions of Outlook they forgot
to make it honour any of the standard confirm supression

"Shay Levi" <no@addre.ss> wrote in message
news:8766a944557c8c9b47e4b97aa18@news.microsoft.com...
>I recreated your scenario and tried various commands, none helped,
>including
> setting $ConfirmPreference to "none".
>
> Then I tried to make the change through the GUI. The confirm dialog
> appears even in the GUI.
>
> I guess the Exchange team refers to this as a significant change, thus you
> cant avoid the dialog.
>
>
> HTH
>
> Shay
> http://scriptolog.blogspot.com
>
>
>
>> I'm having problems running an Exchange shell script automatically
>> because I can't suppress the confirmation prompt. I've tried asking in
>> an exchange group but nobody there could help.
>>
>> The command I'm trying to run is:-
>>
>> get-mailbox | set-mailbox -Confirm:$False -ManagedFolderMailboxPolicy
>> "Default Policy"
>>
>> But I get the prompt:-
>>
>> Confirm
>> When assigning a managed folder mailbox policy with managed custom
>> folders
>> to
>> the mailbox "domain/Users/username", Outlook clients older than
>> Outlook 2007 do not have all available client features and clients
>> older
>> than
>> Outlook 2003 SP2 are not supported. You may use the "Set-CASMailbox"
>> task to
>> enable client version blocking. Are you sure you want to assign a
>> managed
>> folder mailbox policy to this mailbox?
>> [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help
>> (default is "Y"):
>> I've also tried setting $ConfirmPreference="none" or
>> $ConfirmPreference="high" but the prompt still appears
>>
>> Can anyone think of a way to suppress the prompt or automatically
>> answer "A" so I can run this unnattended?
>>
>> Many thanks
>>
>> Peter Lawton
>>

>
>



My System SpecsSystem Spec
Old 08-24-2007   #5 (permalink)
Shay Levi


 
 

Re: suppressing confirmation prompt

BTW, does it prompts for each user in the pipeline or just for the first one?

Shay
http://scriptolog.blogspot.com



> I was afraid of that it's an Exchange team "feature", my suspicion is
> that when they created the custom warning about versions of Outlook
> they forgot to make it honour any of the standard confirm supression
>
>
> "Shay Levi" <no@addre.ss> wrote in message
> news:8766a944557c8c9b47e4b97aa18@news.microsoft.com...
>
>> I recreated your scenario and tried various commands, none helped,
>> including
>> setting $ConfirmPreference to "none".
>> Then I tried to make the change through the GUI. The confirm dialog
>> appears even in the GUI.
>>
>> I guess the Exchange team refers to this as a significant change,
>> thus you cant avoid the dialog.
>>
>> HTH
>>
>> Shay
>> http://scriptolog.blogspot.com
>>> I'm having problems running an Exchange shell script automatically
>>> because I can't suppress the confirmation prompt. I've tried asking
>>> in an exchange group but nobody there could help.
>>>
>>> The command I'm trying to run is:-
>>>
>>> get-mailbox | set-mailbox -Confirm:$False
>>> -ManagedFolderMailboxPolicy "Default Policy"
>>>
>>> But I get the prompt:-
>>>
>>> Confirm
>>> When assigning a managed folder mailbox policy with managed custom
>>> folders
>>> to
>>> the mailbox "domain/Users/username", Outlook clients older than
>>> Outlook 2007 do not have all available client features and clients
>>> older
>>> than
>>> Outlook 2003 SP2 are not supported. You may use the "Set-CASMailbox"
>>> task to
>>> enable client version blocking. Are you sure you want to assign a
>>> managed
>>> folder mailbox policy to this mailbox?
>>> [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?]
>>> Help
>>> (default is "Y"):
>>> I've also tried setting $ConfirmPreference="none" or
>>> $ConfirmPreference="high" but the prompt still appears
>>> Can anyone think of a way to suppress the prompt or automatically
>>> answer "A" so I can run this unnattended?
>>>
>>> Many thanks
>>>
>>> Peter Lawton
>>>



My System SpecsSystem Spec
Old 08-24-2007   #6 (permalink)
Peter Lawton


 
 

Re: suppressing confirmation prompt

It prompts for the first user it comes to that hasn't already got a policy
set, if I answer "Y" to that it'll prompt again at the next one, if I answer
"A" to that it'll run through all the users OK, so I really need to send it
an "A"

Peter Lawton

"Shay Levi" <no@addre.ss> wrote in message
news:8766a94455b68c9b4881e250f44@news.microsoft.com...
> BTW, does it prompts for each user in the pipeline or just for the first
> one?
>
> Shay
> http://scriptolog.blogspot.com
>
>
>
>> I was afraid of that it's an Exchange team "feature", my suspicion is
>> that when they created the custom warning about versions of Outlook
>> they forgot to make it honour any of the standard confirm supression
>>
>>
>> "Shay Levi" <no@addre.ss> wrote in message
>> news:8766a944557c8c9b47e4b97aa18@news.microsoft.com...
>>
>>> I recreated your scenario and tried various commands, none helped,
>>> including
>>> setting $ConfirmPreference to "none".
>>> Then I tried to make the change through the GUI. The confirm dialog
>>> appears even in the GUI.
>>>
>>> I guess the Exchange team refers to this as a significant change,
>>> thus you cant avoid the dialog.
>>>
>>> HTH
>>>
>>> Shay
>>> http://scriptolog.blogspot.com
>>>> I'm having problems running an Exchange shell script automatically
>>>> because I can't suppress the confirmation prompt. I've tried asking
>>>> in an exchange group but nobody there could help.
>>>>
>>>> The command I'm trying to run is:-
>>>>
>>>> get-mailbox | set-mailbox -Confirm:$False
>>>> -ManagedFolderMailboxPolicy "Default Policy"
>>>>
>>>> But I get the prompt:-
>>>>
>>>> Confirm
>>>> When assigning a managed folder mailbox policy with managed custom
>>>> folders
>>>> to
>>>> the mailbox "domain/Users/username", Outlook clients older than
>>>> Outlook 2007 do not have all available client features and clients
>>>> older
>>>> than
>>>> Outlook 2003 SP2 are not supported. You may use the "Set-CASMailbox"
>>>> task to
>>>> enable client version blocking. Are you sure you want to assign a
>>>> managed
>>>> folder mailbox policy to this mailbox?
>>>> [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?]
>>>> Help
>>>> (default is "Y"):
>>>> I've also tried setting $ConfirmPreference="none" or
>>>> $ConfirmPreference="high" but the prompt still appears
>>>> Can anyone think of a way to suppress the prompt or automatically
>>>> answer "A" so I can run this unnattended?
>>>>
>>>> Many thanks
>>>>
>>>> Peter Lawton
>>>>

>
>



My System SpecsSystem Spec
Old 08-24-2007   #7 (permalink)
Shay Levi


 
 

Re: suppressing confirmation prompt

In DOS we could do something like

command < ECHO A

But the input redirection is not implemented in PowerShell v1.0

Shay
http://scriptolog.blogspot.com



> It prompts for the first user it comes to that hasn't already got a
> policy set, if I answer "Y" to that it'll prompt again at the next
> one, if I answer "A" to that it'll run through all the users OK, so I
> really need to send it an "A"
>
> Peter Lawton
>
> "Shay Levi" <no@addre.ss> wrote in message
> news:8766a94455b68c9b4881e250f44@news.microsoft.com...
>
>> BTW, does it prompts for each user in the pipeline or just for the
>> first one?
>>
>> Shay
>> http://scriptolog.blogspot.com
>>> I was afraid of that it's an Exchange team "feature", my suspicion
>>> is that when they created the custom warning about versions of
>>> Outlook they forgot to make it honour any of the standard confirm
>>> supression
>>>
>>> "Shay Levi" <no@addre.ss> wrote in message
>>> news:8766a944557c8c9b47e4b97aa18@news.microsoft.com...
>>>> I recreated your scenario and tried various commands, none helped,
>>>> including
>>>> setting $ConfirmPreference to "none".
>>>> Then I tried to make the change through the GUI. The confirm dialog
>>>> appears even in the GUI.
>>>> I guess the Exchange team refers to this as a significant change,
>>>> thus you cant avoid the dialog.
>>>>
>>>> HTH
>>>>
>>>> Shay
>>>> http://scriptolog.blogspot.com
>>>>> I'm having problems running an Exchange shell script automatically
>>>>> because I can't suppress the confirmation prompt. I've tried
>>>>> asking in an exchange group but nobody there could help.
>>>>>
>>>>> The command I'm trying to run is:-
>>>>>
>>>>> get-mailbox | set-mailbox -Confirm:$False
>>>>> -ManagedFolderMailboxPolicy "Default Policy"
>>>>> But I get the prompt:-
>>>>>
>>>>> Confirm
>>>>> When assigning a managed folder mailbox policy with managed custom
>>>>> folders
>>>>> to
>>>>> the mailbox "domain/Users/username", Outlook clients older than
>>>>> Outlook 2007 do not have all available client features and clients
>>>>> older
>>>>> than
>>>>> Outlook 2003 SP2 are not supported. You may use the
>>>>> "Set-CASMailbox"
>>>>> task to
>>>>> enable client version blocking. Are you sure you want to assign a
>>>>> managed
>>>>> folder mailbox policy to this mailbox?
>>>>> [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?]
>>>>> Help
>>>>> (default is "Y"):
>>>>> I've also tried setting $ConfirmPreference="none" or
>>>>> $ConfirmPreference="high" but the prompt still appears
>>>>> Can anyone think of a way to suppress the prompt or automatically
>>>>> answer "A" so I can run this unnattended?
>>>>> Many thanks
>>>>>
>>>>> Peter Lawton
>>>>>



My System SpecsSystem Spec
Old 08-28-2007   #8 (permalink)
Peter Lawton


 
 

Re: suppressing confirmation prompt

Someone on anotehr group gave me a way to do it now, seems that this
particular Exchange command needs a special switch
"-ManagedFolderMailboxPolicyAllowed" to suppress the confirmation
(standards - we've heard of them ;-)

Get-mailbox | Set-Mailbox -ManagedFolderMailboxPolicy "Policy
Name" -ManagedFolderMailboxPolicyAllowed

Peter Lawton

"Shay Levi" <no@xxxxxx> wrote in message
news:8766a94455f38c9b48ba3356b4a@xxxxxx
Quote:

> In DOS we could do something like
>
> command < ECHO A
>
> But the input redirection is not implemented in PowerShell v1.0
>
> Shay
> http://scriptolog.blogspot.com
>
>
>
Quote:

>> It prompts for the first user it comes to that hasn't already got a
>> policy set, if I answer "Y" to that it'll prompt again at the next
>> one, if I answer "A" to that it'll run through all the users OK, so I
>> really need to send it an "A"
>>
>> Peter Lawton
>>
>> "Shay Levi" <no@xxxxxx> wrote in message
>> news:8766a94455b68c9b4881e250f44@xxxxxx
>>
Quote:

>>> BTW, does it prompts for each user in the pipeline or just for the
>>> first one?
>>>
>>> Shay
>>> http://scriptolog.blogspot.com
>>>> I was afraid of that it's an Exchange team "feature", my suspicion
>>>> is that when they created the custom warning about versions of
>>>> Outlook they forgot to make it honour any of the standard confirm
>>>> supression
>>>>
>>>> "Shay Levi" <no@xxxxxx> wrote in message
>>>> news:8766a944557c8c9b47e4b97aa18@xxxxxx
>>>>> I recreated your scenario and tried various commands, none helped,
>>>>> including
>>>>> setting $ConfirmPreference to "none".
>>>>> Then I tried to make the change through the GUI. The confirm dialog
>>>>> appears even in the GUI.
>>>>> I guess the Exchange team refers to this as a significant change,
>>>>> thus you cant avoid the dialog.
>>>>>
>>>>> HTH
>>>>>
>>>>> Shay
>>>>> http://scriptolog.blogspot.com
>>>>>> I'm having problems running an Exchange shell script automatically
>>>>>> because I can't suppress the confirmation prompt. I've tried
>>>>>> asking in an exchange group but nobody there could help.
>>>>>>
>>>>>> The command I'm trying to run is:-
>>>>>>
>>>>>> get-mailbox | set-mailbox -Confirm:$False
>>>>>> -ManagedFolderMailboxPolicy "Default Policy"
>>>>>> But I get the prompt:-
>>>>>>
>>>>>> Confirm
>>>>>> When assigning a managed folder mailbox policy with managed custom
>>>>>> folders
>>>>>> to
>>>>>> the mailbox "domain/Users/username", Outlook clients older than
>>>>>> Outlook 2007 do not have all available client features and clients
>>>>>> older
>>>>>> than
>>>>>> Outlook 2003 SP2 are not supported. You may use the
>>>>>> "Set-CASMailbox"
>>>>>> task to
>>>>>> enable client version blocking. Are you sure you want to assign a
>>>>>> managed
>>>>>> folder mailbox policy to this mailbox?
>>>>>> [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?]
>>>>>> Help
>>>>>> (default is "Y"):
>>>>>> I've also tried setting $ConfirmPreference="none" or
>>>>>> $ConfirmPreference="high" but the prompt still appears
>>>>>> Can anyone think of a way to suppress the prompt or automatically
>>>>>> answer "A" so I can run this unnattended?
>>>>>> Many thanks
>>>>>>
>>>>>> Peter Lawton
>>>>>>
>
>

My System SpecsSystem Spec
Old 09-10-2007   #9 (permalink)
Mike Parrish


 
 

RE: suppressing confirmation prompt

I used the -ManagedFolderMailboxPolicyAllowed parameter to supress the
confirmation prompt.

"Peter Lawton" wrote:
Quote:

> I'm having problems running an Exchange shell script automatically because I
> can't suppress the confirmation prompt. I've tried asking in an exchange
> group but nobody there could help.
>
> The command I'm trying to run is:-
>
> get-mailbox | set-mailbox -Confirm:$False -ManagedFolderMailboxPolicy
> "Default Policy"
>
> But I get the prompt:-
>
> Confirm
> When assigning a managed folder mailbox policy with managed custom folders
> to
> the mailbox "domain/Users/username", Outlook clients older than
> Outlook 2007 do not have all available client features and clients older
> than
> Outlook 2003 SP2 are not supported. You may use the "Set-CASMailbox" task to
> enable client version blocking. Are you sure you want to assign a managed
> folder mailbox policy to this mailbox?
> [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help
> (default is "Y"):
>
> I've also tried setting $ConfirmPreference="none" or
> $ConfirmPreference="high" but the prompt still appears
>
> Can anyone think of a way to suppress the prompt or automatically answer "A"
> so I can run this unnattended?
>
> Many thanks
>
> Peter Lawton
>
>
>
>
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Re: Suppressing emoticons -- how? Live Mail
Suppressing blank lines in a mail merge .NET General
Program and Features - Restore Uninstall Confirmation Prompt Tutorials
Suppressing a Vista event logging request Vista performance & maintenance
New-Item and suppressing output PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46