cancel
Showing results forΒ 
Search instead forΒ 
Did you mean:Β 

Script not working after EV migration from 2003 to Windows 2008 R2

Holloween
Level 4
Accredited

Dear community,

I have a daily scheduled task running for EV monitoring. It used to work while it is running on the Windows 2003 box. Now that I have migrated to the new 2008 R2 box, the script failed to show any output. Did a search on the net and found out that I need to use 32 bit powershell instead of 64 bit. 

 

After expliciting calling the 32bit powershell, output via email is working fine.

 

This leads to another problem:

When the script comes to this section (Lets call it Section A:(

Cscript //nologo EVMonitor-Queues.vbs servername "servername\private$\Enterprise Vault Exchange Mailbox Task for [ExchangeServername] 111027181710 a2" >> EVCheck.txt

Cscript //nologo EVMonitor-Queues.vbs servername "servername\private$\Enterprise Vault Exchange Mailbox Task for [ExchangeServername] 111027181710 a5" >> EVCheck.txt

 

It does not output to EVCheck.txt.

 

The script contents for EVMonitor-Queues.vbs is as follows:

(I believe, in the past, when the EV is running on the 2003 box, the script is taken from here: https://www-secure.symantec.com/connect/blogs/monitoring-msmq-vbs )

 

Is there any solution to output Section A to a text file? (It used to work on Windows 2003).

 

Option Explicit

Dim MSMQApp ' As MsmqApplication

Set MSMQApp = CreateObject("MSMQ.MSMQApplication")

 

Dim strComputer

 

If Wscript.Arguments.Count = 0 Then

                WScript.Echo "usage: msmq.vbs server_name queue "

                WScript.Echo " "

                WScript.Echo "e.g. cscript msmq.vbs tus1ev1idxpin01 queue"

Else

                strComputer = Wscript.Arguments(0)

END If

 

On Error Resume Next

 

MSMQApp.Machine=strComputer

Dim qName ' As String

For each qName in MSMQApp.PrivateQueues

                Dim Mgmt ' As new MSMQManagement

                Set Mgmt = CreateObject("MSMQ.MSMQManagement")

                Mgmt.Init MSMQApp.Machine,,"DIRECT=OS:" & qName

                if Wscript.Arguments(1) <> "" then

                                           if instr(UCase(qName),UCase(Wscript.Arguments(1))) >0 then

                                                WScript.Echo qName & "     Messages " & CLng(Mgmt.MessageCount) & "    Size: " & int(CLng(Mgmt.BytesInQueue) / 1024) & " Kb"

                               end if

               else

                               WScript.Echo qName & "     Messages " & CLng(Mgmt.MessageCount) & "    Size: " & int(CLng(Mgmt.BytesInQueue) / 1024) & " Kb"

               end if

Next

 

1 ACCEPTED SOLUTION

Accepted Solutions

TonySterling
Moderator
Moderator
Partner    VIP    Accredited Certified

That is what I was referring to above.  The number sequences is a date\time that is generated when the queue is created.

Glad you are sorted.

View solution in original post

5 REPLIES 5

Marianne
Moderator
Moderator
Partner    VIP    Accredited Certified

Moved to EV forum....

TonySterling
Moderator
Moderator
Partner    VIP    Accredited Certified

Did you update the MSMQ Task names?  So in Section A, Is the right name listed?  Enterprise Vault Exchange Mailbox Task for [ExchangeServername] 111027181710 a2

 

Holloween
Level 4
Accredited

Yes I have changed the servername to the new EV server.

Cscript //nologo EVMonitor-Queues.vbs servername "servername\private$\Enterprise Vault Exchange Mailbox Task for [ExchangeServername] 111027181710 a2" >> EVCheck.txt

Cscript //nologo EVMonitor-Queues.vbs servername "servername\private$\Enterprise Vault Exchange Mailbox Task for [ExchangeServername] 111027181710 a5" >> EVCheck.txt

 

When I run the .vbs on the new EV server, there are pop ups. (See attached .docx)

But it just cannot output the a2 and a5 queues to a text file. (See attached output.jpg)

Holloween
Level 4
Accredited

It worked after I changed the values 111027181710 to the correct ones found in the EV server:

Cscript //nologo EVMonitor-Queues.vbs servername "servername\private$\Enterprise Vault Exchange Mailbox Task for [ExchangeServername] 111027181710 a2" >> EVCheck.txt

 

Initially, I thought the values here are hardcoded in between the quotes "servername\private$\Enterprise Vault Exchange Mailbox Task for [ExchangeServername] 111027181710 a2"

 

Meaning to say that initially, I thought this line 

Cscript //nologo EVMonitor-Queues.vbs servername "Hello World" >> EVCheck.txt

Will append "Hello World" into EVCheck.txt

 

Another colleague of mine looked into this issue and from him, I get to know that path in between the quotes are the parameters, and these must match the ones in the EV server

 

In short, I changed the numbers in bold to match the numbers inside the messaging queue of the EV server and it worked!

TonySterling
Moderator
Moderator
Partner    VIP    Accredited Certified

That is what I was referring to above.  The number sequences is a date\time that is generated when the queue is created.

Glad you are sorted.