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.
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.
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.
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.
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
Hello Jeff,
If you are using Exchange SP1, use the -confirn switch:
> 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.
>
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
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
>
>
>
| 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 |