Symantec Management Platform (Notification Server)

 View Only
  • 1.  Message box at Ctrl+alt+delete screen

    Posted Nov 08, 2011 12:54 PM

    Does anyone know of a way to run a task that would display a message box to the monitor at the  Ctrl+alt+delete screen?

     

    Basically we have a multi reboot install setup we have to perform that could take up to 60 minutes to perform and I would like to make the last task in the job to tell the user we are finished with the machine.  Does anyone have a solution for this?



  • 2.  RE: Message box at Ctrl+alt+delete screen

    Posted Nov 08, 2011 10:04 PM

    A workaround would be autologin as administrator during the task, changing the administrator's background to an image like "Task in progress.  When the CTRL-ALT-DEL logon screen appears, the task is done and you may use your computer."  I've seen it done on an ultra-tacky Wordpad file as well.



  • 3.  RE: Message box at Ctrl+alt+delete screen

    Posted Nov 09, 2011 06:49 AM

    This a feature that has plauged us since we started working with Altiris. 

    Using a concept from a techy in England, I did the following:

    1. Locate psexec.exe from Sysinternals on Microsoft's web site. http://technet.microsoft.com/en-us/sysinternals/bb897553

    2.  I used VBSEdit to compile my HTA script into box.exe.  For some reason the SQL portion doesn't work, but the rest does.  Step 3 is below the HTA Code

    <html>
    <!--

    Put a box on the screen to let the user know that a software build is in
    progress.

    *********************************************************************************
    *             Date :  August 4, 2011
    *           Author :  Wolfgang M. Heid
    *********************************************************************************
       
    -->

    <head>
    <title>Software Installation is in Progress</title>
    <HTA:APPLICATION
      APPLICATIONNAME="My HTML application"
      ID="MyHTMLapplication"
      VERSION="1.0"/>
    </head>

    <script language="VBScript">

    Option Explicit

    Dim objWMIService, colItems, objItem, oReg, strKeyPath, strValueName, strValue
    Dim dwValue, objWMISvc, strComputerName, iTimerID
    Dim strComputer, intHorizontal, intVertical, intLeft, intTop, build

    Const HKEY_LOCAL_MACHINE = &H80000002 

    Sub Window_OnLoad
      'This method will be called when the application loads
         
    window.resizeTo 900,600

    strComputer = "."

    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
    Set colItems = objWMIService.ExecQuery("Select * From Win32_DesktopMonitor")
     
     For Each objItem in colItems
      intHorizontal = objItem.ScreenWidth
      intVertical = objItem.ScreenHeight
      If intHorizontal<>"" Then Exit For
     Next
     
    intLeft = (intHorizontal - 900) / 2
    intTop = (intVertical - 600) / 2
    window.moveTo intLeft, intTop
     
    Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
     strComputer & "\root\default:StdRegProv")

    Set objWMIService = Nothing
    Set colItems = Nothing
     
     ' Call the update status sub every 20 seconds
     
    ' UpdateStatus
    ' iTimerID = window.setInterval("UpdateStatus", 5000)
     
    End Sub
      
    Sub UpdateStatus
     
    Const adOpenStatic = 3
    Const adLockOptimistic = 3

    Dim objFSO, objConnection, objRecordSet, objLog

    Set objFSO = CreateObject("Scripting.FileSystemObject")

    Set objWMISvc = GetObject( "winmgmts:\\.\root\cimv2" )
    Set colItems = objWMISvc.ExecQuery( "Select * from Win32_ComputerSystem", , 48 )

    For Each objItem in colItems
     strComputerName = objItem.Name
    Next  

    Set objConnection = CreateObject("ADODB.Connection")
    Set objRecordSet = CreateObject("ADODB.Recordset")

     objConnection.Open _
         "Provider=SQLOLEDB;Data Source=Altiris-ds2;" & _
             "Trusted_Connection=Yes;Initial Catalog=eXpress;" & _
                  "User ID=Somewhere\Over;Password=therainbow;"


     objRecordSet.Open "SELECT * FROM dbo.computer dc INNER JOIN dbo.computer_display dcd on dc.computer_id = dcd.computer_id WHERE dc.[name]='" & strComputerName & "' ", _
     objConnection, adOpenStatic, adLockOptimistic

     objRecordSet.MoveFirst

     PCName.InnerHTML = "PC Name: " & objRecordSet.Fields("name")
     IPAddress.InnerHTML = "IP Address: " & objRecordSet.Fields("ip_address")
     CurrentEvent.InnerHTML = "Current Event: " & objRecordSet.Fields("event_name")

     objRecordSet.Close

    Set objRecordSet = Nothing
    Set objConnection = Nothing  
      
    End Sub

    </script>

    <body bgcolor="white">

    <p align="center">

    <br>
    <br>

     <font size="10">
      <em>
       <strong>
        Patience Please ...
       </strong>
      </em>
     </font>
     
     <br>

     <img src="tgline.gif" width="800" height="5">

     <br>

     <font size="10">
      <em>
       <strong>
        A Software Installation is in Progress
        <br>
        <br>
        Your computer will restart automatically
        <br>
        after the installation is finished.
       </strong>
      </em>
     </font>

     <img src="tgline.gif" width="800" height="5">

     <font size="5">
      <em>
       <strong>
         Please Contact the Helpdesk at
        <br>
         Extension 1234
        <br>
         with any questions.
       </strong>
      </em>
     </font>

     <img src="tgline.gif" width="800" height="5">

     </p>


    <!--{{InsertControlsHere}}-Do not remove this line-->
    </body>
    </html>

     

    Step 3: Copy the psexec and box.exe files to somewhere on drive c:  I use C:\Windows\Temp\WSConfigFiles\WSSupportFiles

    Step 4: This is the script to run it:

    'Display Machine Building Banner

    'vbscript

    Set WS = CreateObject ("WScript.Shell")

    WS.Run "C:\Windows\Temp\WSConfigFiles\WSSupportFiles\PSexec.exe -s -x -i 0 C:\Windows\Temp\WSConfigFiles\WSSupportFiles\Box.exe /accepteula",1,False

    WScript.Quit

     

    Ok, now put it together:

    1. At the top of each job is a Copy File To Job based on Step 3

    2. Add a Reboot

    3. Add the Run Script from Step 4 and viola, you have a work around!

    4. I include a reboot at the end of the job to clear the box.

     

    If anyone fixes the SQL code, please let me know. 

    Here is the orginal inspiration for my version:

    http://www.symantec.com/connect/articles/showing-build-status-deployment-solution-69

    All credit goes to Rhys for the concept!



  • 4.  RE: Message box at Ctrl+alt+delete screen

    Posted Nov 09, 2011 04:24 PM

    Looks real good and I'm almost complete with my version but...

    I just used a command script to execute the program.  Not working with VB and now I don't have to compile the hta to a exe.

    Command Script:

    "C:\RisLog\PSexec.exe" /accepteula -s -x -i 0 mshta "c:\RISLog\complete.hta"


     



  • 5.  RE: Message box at Ctrl+alt+delete screen

    Posted Nov 10, 2011 01:16 PM

    Ok last problem I need help with.

    I have two xcopy task that copy psexec and my hta file down to the local pc.  I then run the command above using a command script but..

    When doing this the NS sits at "waiting for the agent to get the task"

    I think because psexec is sitting open in the command window.

     

    Basically the last task looks like this:

    "C:\RisLog\PSexec.exe" /accepteula -s -x -i 0 mshta "c:\RISLog\complete.hta"
    exit

    Any ideas on how to get this task to complete while leaving the hta up on the screen?

     

    Also for reference I made some mods to your hta and thank you for all this code!  Here is my simplified hta that I use for completion.

    <html>
    <!--

    Put a box on the screen to let the user know that a software build is complete.

    *********************************************************************************
    *             Date :  Nov 9, 2011
    *           Author :  Wolfgang M. Heid
    *      Modified by :  Jamie Lawson
    *********************************************************************************
      
    -->

    <head>
    <title>Software Installation is Complete</title>
    <HTA:APPLICATION
      APPLICATIONNAME="My HTML application"
      ID="MyHTMLapplication"
      VERSION="1.0"/>
    </head>

    <script language="VBScript">

    Option Explicit

    Dim objWMIService, colItems, objItem, oReg, strKeyPath, strValueName, strValue
    Dim dwValue, objWMISvc, strComputerName, iTimerID
    Dim strComputer, intHorizontal, intVertical, intLeft, intTop, build

    Const HKEY_LOCAL_MACHINE = &H80000002

    Sub Window_OnLoad
      'This method will be called when the application loads
        
    window.resizeTo 600,300

    strComputer = "."

    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
    Set colItems = objWMIService.ExecQuery("Select * From Win32_DesktopMonitor")
     
     For Each objItem in colItems
      intHorizontal = objItem.ScreenWidth
      intVertical = objItem.ScreenHeight
      If intHorizontal<>"" Then Exit For
     Next
     
    intLeft = (intHorizontal - 600) / 2
    intTop = (intVertical - 500) / 2
    window.moveTo intLeft, intTop
     
    Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
     strComputer & "\root\default:StdRegProv")

    Set objWMIService = Nothing
    Set colItems = Nothing
     
     ' Call the update status sub every 20 seconds
     
    ' UpdateStatus
    ' iTimerID = window.setInterval("UpdateStatus", 5000)
     
    End Sub
     
    </script>

    <body bgcolor="white">

    <p align="center">

    <br>

     

     <img src="tgline.gif" width="500" height="5">
    <br>
     <font color="RED" size="5">

      <em>
       <strong>
    Install is complete you may now use your Computer
       </strong>
      </em>
     </font>

     <img src="tgline.gif" width="500" height="5">
    <br>
     </p>
    <p align="center">
    <input type="button" value="Close this window" onclick="self.close()">
     </p>
    <!--{{InsertControlsHere}}-Do not remove this line-->
    </body>
    </html>



  • 6.  RE: Message box at Ctrl+alt+delete screen



  • 7.  RE: Message box at Ctrl+alt+delete screen

    Posted Nov 11, 2011 11:18 AM

    Ok I may have fixed my problem.  Probably not the best solution but does work for now.

    my final command script:

    echo %date%,%time%,errorlevel: %errorlevel%,RUN complete.hta: Begin >> c:\RISlog\altiris.log
    "C:\RisLog\PSexec.exe" /accepteula -s -x -d -i 0 mshta "c:\RISLog\complete.hta"
    echo %date%,%time%,errorlevel: %errorlevel%,RUN complete.hta: End >> c:\RISlog\altiris.log
    exit 0

    the -d I think is killing the psexec.exe process and allowing the script to continue but this returns error 1692 so I have forced a 0 return code for success.

     

    If anyone has a better solution I'm open but this appears to work so far.



  • 8.  RE: Message box at Ctrl+alt+delete screen

    Posted Nov 24, 2011 09:23 PM

    Did you get it working?

     

    I consulted with our DBA and have the SQL portion working now.

    Thank you Rhys for the concept and getting me started in the right direction!