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 - Pipe response Yes to ALl

Reply
 
Old 03-11-2009   #1 (permalink)
Jeff


 
 

Pipe response Yes to ALl

I'm trying to run the following command:

Get-Mailbox | set-Mailbox -ManagedFolderMailboxPolicy "Retention Policy"

How do I get it to automatically use the "(A) yes to all" option as I am
running this as a scheduled task.

This one is driving me nuts.

My System SpecsSystem Spec
Old 03-11-2009   #2 (permalink)
Josh Einstein


 
 

Re: Pipe response Yes to ALl

I don't have Exchange but the convention is usually to have a -Force switch.
Is there one?

"Jeff" <Jeff@xxxxxx> wrote in message
news:B21370A3-A656-4CFD-A808-A3F73132EF12@xxxxxx
Quote:

> I'm trying to run the following command:
>
> Get-Mailbox | set-Mailbox -ManagedFolderMailboxPolicy "Retention Policy"
>
> How do I get it to automatically use the "(A) yes to all" option as I am
> running this as a scheduled task.
>
> This one is driving me nuts.
My System SpecsSystem Spec
Old 03-12-2009   #3 (permalink)
Jeff


 
 

Re: Pipe response Yes to ALl

It says "-force" is an invlid paramater

"Josh Einstein" wrote:
Quote:

> I don't have Exchange but the convention is usually to have a -Force switch.
> Is there one?
>
> "Jeff" <Jeff@xxxxxx> wrote in message
> news:B21370A3-A656-4CFD-A808-A3F73132EF12@xxxxxx
Quote:

> > I'm trying to run the following command:
> >
> > Get-Mailbox | set-Mailbox -ManagedFolderMailboxPolicy "Retention Policy"
> >
> > How do I get it to automatically use the "(A) yes to all" option as I am
> > running this as a scheduled task.
> >
> > This one is driving me nuts.
>
My System SpecsSystem Spec
Old 03-12-2009   #4 (permalink)
Kiron


 
 

Re: Pipe response Yes to ALl

Don't have Exchange Cmdlets to verify, but there are two ways you can suppress confirmation :

# set the automatic variable to 'None' or 0 in your script
$ConfirmPreference = 'None'

# pass $false or 0 to the -Confirm switch
... -confirm:$false

--
Kiron
My System SpecsSystem Spec
Old 03-12-2009   #5 (permalink)
Karl Mitschke


 
 

Re: Pipe response Yes to ALl

Hello Jeff,
Quote:

> I'm trying to run the following command:
>
> Get-Mailbox | set-Mailbox -ManagedFolderMailboxPolicy "Retention
> Policy"
>
> How do I get it to automatically use the "(A) yes to all" option as I
> am running this as a scheduled task.
>
> This one is driving me nuts.
>
If you are using Exchange SP1, use the -confirn switch:

Get-Mailbox | set-Mailbox -ManagedFolderMailboxPolicy "Retention Policy"
-confirm: $false

If you are using Exchange RTM, temporarily set $confirmpreference to none:

$preference = $confirmpreference
$confirmpreference = “None”
Get-Mailbox | set-Mailbox -ManagedFolderMailboxPolicy "Retention Policy"
$confirmpreference = $preference


Karl


My System SpecsSystem Spec
Old 03-12-2009   #6 (permalink)
Jeff


 
 

Re: Pipe response Yes to ALl

that was it. thanks so much. Everything I read using Google had me using
-confirm:$false
without the space between : and $.

Thanks

"Karl Mitschke" wrote:
Quote:

> Hello Jeff,
>
Quote:

> > I'm trying to run the following command:
> >
> > Get-Mailbox | set-Mailbox -ManagedFolderMailboxPolicy "Retention
> > Policy"
> >
> > How do I get it to automatically use the "(A) yes to all" option as I
> > am running this as a scheduled task.
> >
> > This one is driving me nuts.
> >
>
> If you are using Exchange SP1, use the -confirn switch:
>
> Get-Mailbox | set-Mailbox -ManagedFolderMailboxPolicy "Retention Policy"
> -confirm: $false
>
> If you are using Exchange RTM, temporarily set $confirmpreference to none:
>
> $preference = $confirmpreference
> $confirmpreference = “None”
> Get-Mailbox | set-Mailbox -ManagedFolderMailboxPolicy "Retention Policy"
> $confirmpreference = $preference
>
>
> Karl
>
>
>
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Using pipe in Powershell PowerShell
RE: is it possible to pipe into switch -r? PowerShell
Pipe a pipe command to a file VB Script
possibly pipe max? PowerShell
getting arguments from pipe 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