Contacting the IT ServiceDesk

A useful hta to which can be put on an intranet or modified into a html form When the user runs the hta say from a url link on an intranet page it automatically queries wmi info and appends the user¶s computername , username, computer manufacturer and model into an email to be sent to IT

Below is the script Copy into notepad modify with your domain info and save with a file extension .HTA ------------------------------------------------------------------------- -------------------------------------------------------------

<head> <title>Email to IT</title>

<HTA:APPLICATION APPLICATIONNAME="Email to IT" BORDER="1" CAPTION="YES" MAXIMIZEBUTTON="NO" MINIMIZEBUTTON="YES" SCROLL="YES" SHOWINTASKBAR="YES" SINGLEINSTANCE="yes" SYSMENU="YES" WINDOWSTATE="NORMAL" > </head> <body STYLE="font:14pt Calibri; color:white; filter:progid:DXImageTransform.Microsoft.Gradient (GradientType=0, StartColorStr='#305090', EndColorStr ='#80A0F3')">

<SCRIPT Language="VBScript"> Dim objWSHNetwork : Set objWSHNetwork= CreateObject("WScript.Network") Dim objWMI : Set objWMI = GetObject("winmgmts:") Dim colSettingsComp : Set colSettings = objWMI.ExecQuery("Select * from Win32_ComputerSystem ")

Dim objComputer, strModel, strManufacturer For Each objComputer in colSettings strModel = objComputer.Model strManufacturer = objComputer.Manufacturer Next

Sub Window_Onload() SetLocalUseInfo() Center_HTA 440, 510 End Sub Sub Center_HTA(widthX, height Y ) self.ResizeTowidthX, heightY self.MoveTo (screen.Width - widthX)/2, (screen.Height - heightY)/2 End Sub Sub SetLocalUseInfo() spn_ComputerID.InnerText = objWSHNetwork.ComputerName spn_UserID.InnerText = objWSHNetwork.UserDomain& " \" &objWSHNetwork.User Name spn_Manufacturer.InnerText = strManufacturer spn_Model.InnerText = strModel End Sub Sub btn_Submit_onClick() Call SendMail("", objWSHNetwork.UserName& "", "Issue Report: " &objWSHNetwork.ComputerName& " " &strManufacturer& " \" &strModel , Replace(document.Body.InnerText, "Submit", "")) End Sub Sub SendMail(ToAddress, FromAddress, MsgSubject, MsgBody) Dim objEmail : Set objEmail = CreateObject("CDO.Message")

With objEmail .From = FromAddress .To = ToAddress .Subject = MsgSubject .HTMLbody = MsgBody '.Body = "You can send plain text" 'If objFSO.FileExists(strLog) Then .AddAttachmentstrLog

.Configuration.Fields.Item(" do/configuration/ sendusing") = 2

.Configuration.Fields.Item(" smtpserver") = "MY_SMTP_RELAY"

.Configuration.Fields.Item(" smtpserverport") = 25 .Configuration.Fields.Update

.Send End With End Sub </SCRIPT> </head> <hta:application applicationname="Incident" border="dialog" borderstyle="normal" caption="yes" contextmenu="yes" icon="no.ico" maximizebutton="yes" minimizebutton ="yes" navigable="yes" scroll="yes" selection="yes" showintaskbar="yes" singleinstance="yes" sysmenu="yes" version="1.0"

windowstate="normal" > <body style="text -align:center;"> <h2>Contacting The IT ServiceDesk</h2> <br> <b>ComputerName:</b>&nbsp&nbsp<spa n id="spn_ComputerID"></span> <br> <b>UserName</b>:&nbsp&nbsp<span id="spn_UserID"></span> <br> <b>Manufacturer:</b>&nbsp&nbsp<span id="spn_Manufacturer"></span> <br> <b>Model</b>:&nbsp&nbsp<span id="spn_Model"></span> <br> <br> <b>Query or Error Descript ion:</b> <br> <br> <textarea id="txa_Problem" rows="10" cols="40"></textarea> <br> <br> <button class="button" id="btn_Submit" title="Submit my incident">Submit</button>&nbsp&nbsp </body> </html>