Tuesday, May 28, 2013

OSD Complete msg box in Task Sequence

When you are migrating whole floor with 90 people, it is hard for the floorwalkers to keep an eye on the build process and see which one built properly and which one are failed before they login to the PC.
So, here is an idea of creating a pop-up message before displaying logon screen window. So the floor walker can go and click OK on the msg window.

Step 1:
First, crate a VBScript with a MSG box. Below is the sample script.

********************************************************************************
' Hide the progress dialog

Set oTSProgressUI = CreateObject("Microsoft.SMS.TSProgressUI")
oTSProgressUI.CloseProgressDialog
Set oTSProgressUI = Nothing

‘ Msg box to Display the msg

MsgBox "Windows 7 Operating System deployed Successfully."& vbCrLf & vbCrLf & _
     "Please click OK To logon to your computer", 64, "Operating System Deployment Successful"


Save above VBScript as OSDComplete.vbs and create a package with the script then distribute to all the distribution points.

Step 2:
Create a group and call it “OSD Completed” in the task sequence as a last group.


Under this group add “Run Command line” and on the properties of Run Command line
Name: OSD Complete
Description: <Add your comments if you want to>
Command line: C:\Windows\System32\cscript.exe OSDComplete.vbs

Select the box for “Disable 64-bit file system redirection”

Select the package and browse to your OSDComplete-R01 package

That is it.
Now start building the machine. When the task Sequence reached to TS Complete stage, it will display the following message.

12 comments:

  1. Good one mate.
    I wanted to do similar one like this but didn't know where to start.
    This worked well.

    ReplyDelete
    Replies
    1. Does not work anymore for MDT Windows 10 tasks.

      Delete
  2. I needed this for my builds aswell.
    It gave me an idea then i used my own HTA script to create the msg.
    welldone.

    ReplyDelete
  3. I have used your HTA and it worked easy as.

    ReplyDelete
  4. I have used this method then noticed one problem. If we click anywhere out side the MSG box,
    the MSG will goes background and we can not see it anymore.
    Is there anyway to avoid this problem?

    Thanks,
    Gerard

    ReplyDelete
  5. Hi Anonymous, if the focused window changes then the MSG box will stay behind the other window.
    To bring the MSG window you can use CTRL+TAB key or make your MSG window full screen which will solve the problem but the MSG window may look ugly.
    An other way is use MDT OS branding option, if you have MDT integrated with SCCM.

    ReplyDelete
  6. hi, does the package just have to contain the VBS file ? No program inside the package, correct ?

    ReplyDelete
  7. Hi Steven,
    You are correct. You do not need a program.
    Create a package then add a run command line action as showed above then run the commands with the VB script name.

    ReplyDelete
  8. Hello,

    Does this work on Windows 8.1? - I tried to run this and got an 'ActiveX component can't create object:Microsoft.SMS.TSProgressUI'

    I haven;t ran this via task sequence, I'm just testing on a standalone PC.

    ReplyDelete
  9. Hi,
    It works on Windows 8.1 aswell.
    When you run on the local machine you will get that error.
    If you want to test the script on the local machine comment out below three lines in the script;
    Set oTSProgressUI = CreateObject("Microsoft.SMS.TSProgressUI")
    oTSProgressUI.CloseProgressDialog
    Set oTSProgressUI = Nothing

    after commenting out above three lines, run the script then you will get a MSG box.

    ReplyDelete
  10. I am having trouble getting this to work. Can I just copy the script above into a text file and change it to .vbs? Do I need to make any changes?

    ReplyDelete
    Replies
    1. check for the quotation marks " they are sometime formatted differentlywhen you copy from a website into a text file

      Delete