All Apps and Add-ons

Splunk for Microsoft Exchange App get-databasestats.ps1 Error

imarks004
Path Finder

Has anyone seen the below error with the fwd_exchange2007_store \bin\get-databasestats.ps1 powershell script? I see this on all for mailbox servers(2active/2passive). I am troubleshooting why some events are not populating back into my indexers and this looked like a good place to start. It seems like most of my Exchange data is populating correctly with just a few exceptions that I am trying to clean up.


09-02-2011 14:20:00.480 -0400 ERROR ExecProcessor - message from ""C:\Program Files\SplunkUniversalForwarder\etc\apps\fwd_exchange2007_store\bin\exchangepowershell.cmd" get-databasestats.ps1" The operation '[System.UInt64] / [System.UInt64]' is not defined.
09-02-2011 14:20:00.480 -0400 ERROR ExecProcessor - message from ""C:\Program Files\SplunkUniversalForwarder\etc\apps\fwd_exchange2007_store\bin\exchangepowershell.cmd" get-databasestats.ps1" At C:\Program Files\SplunkUniversalForwarder\etc\apps\fwd_exchange2007_store\bi
09-02-2011 14:20:00.480 -0400 ERROR ExecProcessor - message from ""C:\Program Files\SplunkUniversalForwarder\etc\apps\fwd_exchange2007_store\bin\exchangepowershell.cmd" get-databasestats.ps1" n\powershell\get-databasestats.ps1:32 char:45
09-02-2011 14:20:00.480 -0400 ERROR ExecProcessor - message from ""C:\Program Files\SplunkUniversalForwarder\etc\apps\fwd_exchange2007_store\bin\exchangepowershell.cmd" get-databasestats.ps1" + $EdbDriveFree = ($EdbDriveInfo.FreeSpace / <<<< $EdbDriveInfo.Size)
09-02-2011 14:20:00.480 -0400 ERROR ExecProcessor - message from ""C:\Program Files\SplunkUniversalForwarder\etc\apps\fwd_exchange2007_store\bin\exchangepowershell.cmd" get-databasestats.ps1" * 100.00

1 Solution

donwant
Explorer

There is a bug with Powershell v1 apparently. If you edit the databasestats and cast one or both of the variables to a long it will work.
To cast it to a long just put [long] in front of the variable.

I can't find the reference I used to fix this yesterday now so I can't give proper credit unfortunately.
Correction: finally found the reference!
http://www.techtalkz.com/microsoft-windows-powershell/466362-completely-easy-question-division.html

View solution in original post

0 Karma

donwant
Explorer

There is a bug with Powershell v1 apparently. If you edit the databasestats and cast one or both of the variables to a long it will work.
To cast it to a long just put [long] in front of the variable.

I can't find the reference I used to fix this yesterday now so I can't give proper credit unfortunately.
Correction: finally found the reference!
http://www.techtalkz.com/microsoft-windows-powershell/466362-completely-easy-question-division.html

0 Karma

imarks004
Path Finder

Thanks, adding the [long] in front of the variables fixed this issue.

0 Karma

ahall_splunk
Splunk Employee
Splunk Employee

Can you possibly contact me at msexchange@splunk.com so I can incorporate this into the next release?

0 Karma

ahall_splunk
Splunk Employee
Splunk Employee

The key part here is that the [System.UInt64] / [ System.UInt64] is not defined. This is a core feature of Powershell, so it's likely that there is a problem with your Powershell implementation. To diagnose further, you can run this outside of the Splunk system to see what the error is. To do this, run the get-databasestats.ps1 at a powershell command prompt. It should run to completion without errors.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...