Use DaRT RemoteViewer to monitor your OSD Deployments

November 23, 2011 at 8:26 am in Uncategorized by nsienaert

Hi There!

Last week I presented a Technet Livemeeting talking about DaRT 7.0.

For people that missed it you can find the recording HERE.

During the presentation we talked about tHe new DaRT feature, Remote Connection and how we can use the involved files to monitor OSD Deployments.

The Remote Connection tool works with the DaRT Remote Viewer tool where the ticketnumber of the remote sessions, IP address and port needs to be provided to establish the remote RDP connection.

Remote Viewer tool:

Dart OSD 4

As in quite some circumstances IT people are not available “on the other side” to communicate the appropriate info to the IT Admin that wants to establish the remote connection. I have created a script that automates this process. Without the script the RDP connection will stay in a pending state as showed in the picture below until someone fills in the info in the Remote Viewer tool.

Dart OSD 2

So what is the script doing exactly? Well quite simple…

- it will look into inv32.xml to find the IP Address, Port and TicketNumber of the remote   session.

- it will create a batch file on a central store with the necessary parameters:

ex.: DartRemoteViewer.exe -ticket=361-970-210 -IPaddress=172.30.14.131 -port=3388

Make sure following files are in the central store:

Dart osd 3

-If you as admin want to remote view, just hit the batch file and the connection will be established.

Dart osd 5

If some stuff is not clear, please check the recording first.

The script:

‘====================================================================


‘ NAME: Automate Remote Monitoring (DaRT)

‘ AUTHOR: Nico Sienaert,
‘ DATE  : 20/09/2011


‘=====================================================================

‘Map network drive

Set objNetwork = CreateObject("WScript.Network")
strDriveLetter = "M:"
strHomeServer = "\\<SERVER>\DaRT_Remote$"
strusername = "<domain>\<account>"
strPassword = "<password>"
strprofile = "false"
objNetwork.MapNetworkDrive strDriveLetter, strHomeServer, strprofile, strUsername, strPassword

Set oFSO = CreateObject("Scripting.FileSystemObject")
sFile = "X:\windows\system32\inv32.xml"
If oFSO.FileExists(sFile) Then 
        Set oFile = oFSO.OpenTextFile(sFile, 1)  
        Do While Not oFile.AtEndOfStream   
        sText = oFile.ReadLine    
                If Trim(sText) <> "" Then     
               
                ‘Find Session ID
               
                strfindID = InStr(sText, "ID=")
               
                strfindID1 = strfindID + 4
               
                strtofindID = Mid(sText,strfindID1,11)
           
               
                ‘Find Port
               
                strfindPort = InStr(sText, "P=")
               
                strfindPort1 = strfindPort + 3
               
                strtofindPort = Mid(sText,strfindPort1,4)
               
               
                ‘Find IP Address
               
                strcomputer = "."
                Set objWMIService = GetObject("winmgmts:" _
                & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
                Set colItems = objWMIService.ExecQuery _ 
                ("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True")  
                strCount = 1
               
                            For Each objitem in colItems
                              If strCount = 1 Then
                                    
                                  stripaddress = objitem.IPAddress(0)
                                       
                             
                           
                                    ‘Create Batch File
                                   
                                   
                                    Set objFSO = CreateObject("Scripting.FileSystemObject")
                                   
                                    ‘Open write stream
                                    Set outFile = objFSO.CreateTextFile("M:\"& strtofindid &".cmd", True)
                                   
                                    ‘Write each command line
                                   
                                    outFile.WriteLine "DartRemoteViewer.exe" & " " & "-ticket=" & strtofindid & " " & "-IPaddress=" & stripaddress & " " & "-port=" & strtofindport
                                   
                                    ‘Close write stream
                                    outFile.Close
                           
                           
                              Else   
                           
                             End If
 
                            Next
  

                End If  

        Loop 

    oFile.Close

Else 

‘WScript.Echo "The file was not there."

End If

Till next time!

Nico Sienaert

imagesCAIOYXPP