Dismount-Database wierd exception
From the Exchange Management Shell, I can execute the following command:
Dismount-Database -Identity "Mailbox Database"
If I then follow this with:
Get-MailboxDatabase -Identity "Mailbox Database" -Status
The "Mounted" field contains "False".
Using a managed C++ program I can execute any Exchange Server command from the "Microsoft.Exchange.Management.PowerShell.Admin"snapins using RunspaceInvoke->Invoke("Command").
However, if I try to run the Dismount-Database, an exception is thrown with the following message:
"System.Management.Automation.CmdletInvocationException: Cannot invoke this function because the current host does not implement it.at System.Management.Automation.Internal.Host.InternalHostRawUserInterface.ThrowNotIntercative()at System.Management.Automation.Internal.Host.InternalHostUserInterface.PromptForChoice(String caption, String message, Collect"
Clearly, this command is looking for the interactive reply of "Y" however, theDismount-Database command interface does not support a "-Force" option. Is there a way to format this command such that the RunspaceInvoke will execute it properly?
December 14th, 2006 11:12pm
After many days of searching, I found an article that shows that the solution is as follows:
Dismount-Database -Identity "Mailbox Database" -Confirm:$false
How the author of this fix located the information in the documentation is beyond me. I've looked and looked.
Free Windows Admin Tool Kit Click here and download it now
January 2nd, 2007 11:12pm
I ran into the same problem with Move-StorageGroupPath cmdlet. This one includes a "Force" parameter which didnt seem to work,but after alot of fooling around I found I needed this "Confirm" parameter also when using RunSpaceInvoke. Thanks for posting your solution.
February 16th, 2007 4:35am
Thanks for your posting Fletcher. That was really helpful while I was doing the same thing with Powershell.
Free Windows Admin Tool Kit Click here and download it now
March 23rd, 2007 3:20pm
Many thanks. you saved me a lot of time messing around with this. Cheers
December 4th, 2007 8:51am