passing additional command to a powershell task
Hi all, I have a scheduled task that calls a powershell script that moves some mailboxes from one mailbox database to another. Here is the code for the batch file: PowerShell.exe -PSConsoleFile "C:\Program Files\Microsoft\Exchange Server\Bin\ExShell.psc1" -Command ".'z:\movemailboxes.ps1' z: \aliases.csv -TargetDatabase "ssv-mailboxes\Emeryville \Scratch_Utilities"" The problem is, in order for this to work properly, i need to confirm that i want this move to happen, i get prompted with the typical Yes, Yes to All, No, No to all etc. How do I have this pass the A for Yes to All to my powershell command. Any assistance would be greatly appreciated. aaron
November 19th, 2008 1:43am

Dear customer: The Confirm parameter instructs the command to which it is applied to stop processing before any changes are made. The command then prompts you to acknowledge each action before it continues. When you use the Confirm parameter, you can step through changes to objects to make sure that changes are made only to the specific objects that you want to change. This functionality is useful when you apply changes to many objects and want precise control over the operation of the Exchange Management Shell. A confirmation prompt is displayed for each object before the Exchange Management Shell modifies the object. By default, the Exchange Management Shell automatically applies the Confirm parameter to cmdlets that have the following verbs: Remove Move Stop Clear Suspend Uninstall Dismount Disable When a cmdlet runs that has any of these verbs, the Exchange Management Shell automatically stops the command and waits for your acknowledgement before it continues to process. You can try to add -ConfirmFalse parameter at the end of your command and check the effect. For more inform about WhatIf, Confirm, and ValidateOnly Parameters, you can refer to the following article: WhatIf, Confirm, and ValidateOnly Parameters http://technet.microsoft.com/en-us/library/bb124088.aspx Hope it helps. Rock Wang - MSFT
Free Windows Admin Tool Kit Click here and download it now
November 19th, 2008 6:18am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics