![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | execute Exchange script from DOS - how to get result? how can I ran this script from a dos batch file and get the exit code? the batch file suppose to do A if the DB is mounted and to do B if not is-mounted.ps1 : *********** PARAM ($ServerName) $DBmount = Get-Mailboxdatabase -server $ServerName -status | where {$_.Mounted -eq $false} if ($DBmount -eq $null){"All DB are mounted";exit 1} if ($DBmount -ne $null){"NOTnAll DB are mounted";exit 2} |
My System Specs![]() |
| | #2 (permalink) |
| | RE: execute Exchange script from DOS - how to get result? a quick and simple way could be to write the exit code in a plain file in your TEMP-path and after that read that file from your batch. "Exchange2007-Q" wrote: Quote: > how can I ran this script from a dos batch file and get the exit code? > the batch file suppose to do A if the DB is mounted and to do B if not > > is-mounted.ps1 : > *********** > PARAM ($ServerName) > > $DBmount = Get-Mailboxdatabase -server $ServerName -status | where > {$_.Mounted -eq $false} > > if ($DBmount -eq $null){"All DB are mounted";exit 1} > if ($DBmount -ne $null){"NOTnAll DB are mounted";exit 2} |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| how to execute query which is use to truen result like pivot table | .NET General | |||
| Permissions to execute the script | VB Script | |||
| powershell script to execute simultaneously instead of sequentially | PowerShell | |||
| Execute a powershell script from a webpage | PowerShell | |||
| execute powershell script from commmand line | PowerShell | |||