Reply Value in a script?

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
THEngels
Posts: 6
Joined: Tue Sep 04, 2007 2:53 am
Location: Wijnandsrade (NL)

Reply Value in a script?

Post by THEngels »

Hi, first off let me say that I'm an intern at an IT company, so sorry if my questions are stupid, but here goes :)

I've written the following script with some Google and ScriptCenter work to check the filesize from a clients Exchange DB and compare this size to the manually set limit which can be found in Registry.

Code: Select all

'==========================================================================
'
' VBScript Source File -- Created with SAPIEN Technologies PrimalScript 3.0
'
' NAME: Filesize test script
'
' AUTHOR: T.T.H.Engels , 
' DATE  : 1-11-2007
'
' COMMENT:
'
'==========================================================================

const HKEY_CURRENT_USER = &H80000001
const HKEY_LOCAL_MACHINE = &H80000002

Dim objShell, Max, i
'============================Lees remote register =========================
strComputer = "SERVERNAME"
 
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
 
strKeyPath = "SYSTEM\CurrentControlSet\Services\MSExchangeIS\SERVERNAME\Private-*cut*"
strValueName = "Database Size Limit in GB"

oReg.GetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
WScript.Echo "Test123 : " & strValue' 

Max = strValue
'==========================================================================

'=================================Set values================================
Max = Max -1
Int i
i = 0

'==========================================================================

'=================================Test=====================================
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile1 = objFSO.GetFile("\\SERVERNAME\disk$\MDBDATA\priv1.stm")
Set objFile2 = objFSO.GetFile("\\SERVERNAME\disk$\MDBDATA\priv1.edb")
const statusOk   = "scriptRes:Ok:"
const statusBad  = "scriptRes:Bad:"
file1 = objFile1.Size/1024/1024/1024
file2 = objFile2.Size/1024/1024/1024
i= file1 + file2

If  i > Max Then
		WScript.StdOut.Write statusBad
		'Wscript.echo "Exchange database is to big: "&i
	Else
		WScript.StdOut.Write statusOk
		'Wscript.echo "Exchange Database Priv1.stm is: "&file1
		'Wscript.echo "Exchange Database Priv1.edb is: "&file2
End If
'==========================================================================
Now, my question is; How can I add a "Reply:" field? I couldn't find it anywhere.
This script is implemented in such a way that it generates a mail to our company, what I want is that this mail doesn't only say:
"Scriptname
---------------
Status:Bad
Reply:
------------- "

I want there to be some kind of comment in the reply field.

Thanks a lot for any help :)

[edit]Hehe pretty stupid on my end indeed :D
Changed const statusBad = "scriptRes:Bad:" to
const statusBad = "scriptRes:Bad:This is my error"

This topic can be closed :D[/edit]
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

You are fast learner :)

Regards
Alex
Post Reply