Windows Vista Forums

Pipe response Yes to ALl

  1. #1


    Jeff Guest

    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

  2. #2


    Josh Einstein Guest

    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

    > 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

  3. #3


    Jeff Guest

    Re: Pipe response Yes to ALl

    It says "-force" is an invlid paramater

    "Josh Einstein" wrote:

    > 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

    > > 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

  4. #4


    Kiron Guest

    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

  5. #5


    Karl Mitschke Guest

    Re: Pipe response Yes to ALl

    Hello Jeff,

    > 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

  6. #6


    Jeff Guest

    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:

    > Hello Jeff,
    >

    > > 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

Pipe response Yes to ALl

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using pipe in Powershell jonab PowerShell 12 29 Jul 2009
Pipe Yes or No to cmdlet Patrick Fitchie PowerShell 3 03 Nov 2008
RE: is it possible to pipe into switch -r? Kiron PowerShell 0 16 Jul 2008
Pipe a pipe command to a file WB VB Script 2 15 Jul 2008
possibly pipe max? Frank PowerShell 3 28 Nov 2007