Home All Groups Group Topic Archive Search About

Confirm-promt in PS-script

Author
10 Nov 2007 12:44 PM
jer
I wrote a script to assign a mailbox policy to users created in the last 24
hours:

$today=get-date
$yesterday=$today.AddDays(-1d)
get-mailbox -resultsize unlimited | Where-Object {$_.WhenCreated -gt
"$yesterday"} | Set-Mailbox -ManagedFolderMailboxPolicy "Empty deleted items
folder once a week"

However, there is a problem. I get this promt when running the script:

Confirm
When assigning a managed folder mailbox policy with managed custom folders
to
the mailbox "adm.no/Users/Test Policy", 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 tried to add -confirm:$false, but it didn`t help.


Any suggestions?

Author
10 Nov 2007 5:06 PM
jer
"-ManagedFolderMailboxPolicyAllowed" did it.

Show quote
"jer" <j**@rbk.cc> skrev i melding
news:78A57FCF-7BFF-42F4-8FC3-F8811C21E8D4@microsoft.com...
>I wrote a script to assign a mailbox policy to users created in the last 24
>hours:
>
> $today=get-date
> $yesterday=$today.AddDays(-1d)
> get-mailbox -resultsize unlimited | Where-Object {$_.WhenCreated -gt
> "$yesterday"} | Set-Mailbox -ManagedFolderMailboxPolicy "Empty deleted
> items folder once a week"
>
> However, there is a problem. I get this promt when running the script:
>
> Confirm
> When assigning a managed folder mailbox policy with managed custom folders
> to
> the mailbox "adm.no/Users/Test Policy", 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 tried to add -confirm:$false, but it didn`t help.
>
>
> Any suggestions?

AddThis Social Bookmark Button