Exchange 2007 Database state check
Exchange 2007 Database state check
Hi
can someone please tell me if there is a test that i can do to check exchange 2007 database stae (mount or dismount) ?
is there any test that can do this ?
thanks
can someone please tell me if there is a test that i can do to check exchange 2007 database stae (mount or dismount) ?
is there any test that can do this ?
thanks
I think you may use Shell Script test method and script like the following
Command to start script: powershell.exe %script% %params%
Parameters: just 1 parameter that should specify hostname and database name, e.g. servername\databasename
More information about Shell Script test method
http://www.ks-soft.net/hostmon.eng/mfra ... m#chkShell
Regards
Alex
Code: Select all
$statusOk = "ScriptRes:Ok:"
$statusBad = "ScriptRes:Bad:"
dd-PSSnapin Microsoft.Exchange.*
$mounted = (Get-MailboxDatabase -Identity $args[0] -status).Mounted
if($mounted)
{echo $statusOk}
else
{echo $statusBad}
Parameters: just 1 parameter that should specify hostname and database name, e.g. servername\databasename
More information about Shell Script test method
http://www.ks-soft.net/hostmon.eng/mfra ... m#chkShell
Regards
Alex
-
- Posts: 7
- Joined: Tue Mar 23, 2010 11:41 am
I know this topic is old but I am having trouble getting this test to work. Test status returns as bad but I know 100% the info store is mounted.
Params:
MyCompany/Engineering Database
Start cmd:
powershell.exe %script% %params%
Script:
$statusOk = "ScriptRes:Ok:"
$statusBad = "ScriptRes:Bad:"
Add-PSSnapin Microsoft.Exchange.*
$mounted = (Get-MailboxDatabase -Identity $args[0] -status).Mounted
if($mounted)
{echo $statusOk}
else
{echo $statusBad}
Any Ideas? This is running against Exchange 2007.
Params:
MyCompany/Engineering Database
Start cmd:
powershell.exe %script% %params%
Script:
$statusOk = "ScriptRes:Ok:"
$statusBad = "ScriptRes:Bad:"
Add-PSSnapin Microsoft.Exchange.*
$mounted = (Get-MailboxDatabase -Identity $args[0] -status).Mounted
if($mounted)
{echo $statusOk}
else
{echo $statusBad}
Any Ideas? This is running against Exchange 2007.
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
-
- Posts: 7
- Joined: Tue Mar 23, 2010 11:41 am
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
1. Please use backslash ( \ ) instead of slash ( / ) for database path, like 'MyCompany\Engineering Database'
2. If ShellScript runs on local server (where Exchange is located) you may try to use just database name like 'Engineering Database'
If Scrip still doesn't work, try the following:
1. Start powershell.exe
2. run command Add-PSSnapin Microsoft.Exchange.*
3. run command Get-MailboxDatabase
4. Can you see your databases after Get-MailboxDatabase was executed ?
5. Do you see any error messages after these commands ?
2. If ShellScript runs on local server (where Exchange is located) you may try to use just database name like 'Engineering Database'
If Scrip still doesn't work, try the following:
1. Start powershell.exe
2. run command Add-PSSnapin Microsoft.Exchange.*
3. run command Get-MailboxDatabase
4. Can you see your databases after Get-MailboxDatabase was executed ?
5. Do you see any error messages after these commands ?
-
- Posts: 7
- Joined: Tue Mar 23, 2010 11:41 am
KS-Soft Europe wrote:1. Please use backslash ( \ ) instead of slash ( / ) for database path, like 'MyCompany\Engineering Database'
2. If ShellScript runs on local server (where Exchange is located) you may try to use just database name like 'Engineering Database'
If Scrip still doesn't work, try the following:
1. Start powershell.exe
2. run command Add-PSSnapin Microsoft.Exchange.*
3. run command Get-MailboxDatabase
4. Can you see your databases after Get-MailboxDatabase was executed ?
5. Do you see any error messages after these commands ?
1. I'm sorry, I was originally using a backslash ( \ ).
2. It does run locally, I tried to use just 'Engineering Database', same result.
I can see the databases using your instructions, no errors.
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
What HostMonitor version do you use ?
What Windows do you use ? Service Pack ? x86, x64 ?
Also, I noticed mistake in script of second post.
there should be:
Add-PSSnapin Microsoft.Exchange.*
instead of:
dd-PSSnapin Microsoft.Exchange.*
Please check if you are using right command: Add-PSSnapin Microsoft.Exchange.*
Also, you may check if database name is correct using powershell.exe with the following commandlets:
1. Add-PSSnapin Microsoft.Exchange.*
2. Get-MailboxDatabase -Identity 'MyCompany/Engineering Database'
What Windows do you use ? Service Pack ? x86, x64 ?
Also, I noticed mistake in script of second post.
there should be:
Add-PSSnapin Microsoft.Exchange.*
instead of:
dd-PSSnapin Microsoft.Exchange.*
Please check if you are using right command: Add-PSSnapin Microsoft.Exchange.*
Also, you may check if database name is correct using powershell.exe with the following commandlets:
1. Add-PSSnapin Microsoft.Exchange.*
2. Get-MailboxDatabase -Identity 'MyCompany/Engineering Database'
-
- Posts: 7
- Joined: Tue Mar 23, 2010 11:41 am
8.86
Windows 2008 Server Enterprise x64 Edition Service Pack 2
My script has the correct "Add-PSSnapin Microsoft.Exchange.*". I did notice that error when I first came across this script.
PS C:\Users\administrator> Add-PSSnapin Microsoft.Exchange.*
PS C:\Users\administrator>
PS C:\Users\administrator> Get-MailboxDatabase -Identity 'Engineering Databa
se'
Name Server StorageGroup Recovery
---- ------ ------------ --------
Engineering Database EXCHANGE Engineering Stora... False
Windows 2008 Server Enterprise x64 Edition Service Pack 2
My script has the correct "Add-PSSnapin Microsoft.Exchange.*". I did notice that error when I first came across this script.
PS C:\Users\administrator> Add-PSSnapin Microsoft.Exchange.*
PS C:\Users\administrator>
PS C:\Users\administrator> Get-MailboxDatabase -Identity 'Engineering Databa
se'
Name Server StorageGroup Recovery
---- ------ ------------ --------
Engineering Database EXCHANGE Engineering Stora... False
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
Looks like problem is related to different powershell versions x86 and x64.
You start powershell 64 bit version, while HostMonitor calls 32 bit.
Could you please copy x64 powershell.exe from default location (C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe)
to some other location (path should not include word "powershell") E.g. c:\win64tools\powershell.exe
Then specify it in "start CMD" of ShellScript test, like:
c:\win64tools\powershell.exe %Script% %Params%
instead of
powershell.exe %script% %params%
This will make HostMonitor use 64 bit powershell.
You start powershell 64 bit version, while HostMonitor calls 32 bit.
Could you please copy x64 powershell.exe from default location (C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe)
to some other location (path should not include word "powershell") E.g. c:\win64tools\powershell.exe
Then specify it in "start CMD" of ShellScript test, like:
c:\win64tools\powershell.exe %Script% %Params%
instead of
powershell.exe %script% %params%
This will make HostMonitor use 64 bit powershell.
-
- Posts: 7
- Joined: Tue Mar 23, 2010 11:41 am
That did it, it is now working. Really appreciate your help with this issue.
Here are my final test settings.
Params: 'Engineering Database'
Start CMD: C:\SYSTEMTOOLS\powershell.exe %script% %params%
Script:
Here are my final test settings.
Params: 'Engineering Database'
Start CMD: C:\SYSTEMTOOLS\powershell.exe %script% %params%
Script:
Code: Select all
$statusOk = "ScriptRes:Ok:"
$statusBad = "ScriptRes:Bad:"
Add-PSSnapin Microsoft.Exchange.*
$mounted = (Get-MailboxDatabase -Identity $args[0] -status).Mounted
if($mounted)
{echo $statusOk}
else
{echo $statusBad}
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact: