Vista Logon Scripts – Launchapp.wsf
After switching to Vista (18 months ago…beta 2), I realized that my logon script wasn’t running anymore, but I didn’t really pay attention to it until this week…I’m needing to roll out Vista computers to some users at the office…so I need the logon scripts to work. In doing some research I found out why they don’t work. I won’t do a full write up of the reason, but basically it has to do with User Account Control and whether or not the user is a local admin on the computer. You can read a decent description of the issue here.
To get the logon script to work in this instance, you need to use a script named launchapp.wsf (scroll all the way to the bottom of that link) that you can get from the Technet site. That script is one that you use to launch your logon script. It schedules the script to run as a task as the interactive user. It works well…but there are a few issues that I read about and experienced personally.
First, launchapp.wsf does not work for an XP client. So…if a user logs in on a Vista computer and an XP computer…the logon script will work on one or the other…but not both. Or if you are using a GPO to assign your logon script, then it will only work for either XP computers or Vista computers.
Second, if you run multiple scripts (or the same script multiple times), the first will run, but the others will fail. This is because launchapp.wsf creates a scheduled task with a name of “Launch App As Interactive User”. It fails because it can’t create the second task with the same name.
So, I set out to fix those two issues. First, let me say that I am not a great scripter. I understand VBScript. I can write it…I’m not great, but I am adequate. One aspect of script writing that I am very good at is copying something that someone else wrote and massaging it to fit my purpose. That is what I did to fix these problems…a combination of massaging others’ code and writing some of my own.
To fix the issue of launchapp not working with XP, I added a section of code that determines the OS. If the OS is XP, it runs the logon script normally. If it is Vista, it runs it via scheduling the task.
Fixing the multiple scripts / multiple runs issue was more difficult. What I was able to deduce is that the issue is a missing setting in the original launchapp.wsf that you can copy off of the Technet site. Basically when the task is scheduled, it doesn’t expire. I dug through and found the property to set (EndBoundary). I set the script to make the task expire in two minutes. To do that I had to find a way of adding two minutes to the current time and format the date/time to fit the way that EndBoundary requires. Once adding that to the launchapp script, it wasn’t a problem.
You can download my modified version of Launchapp (PDF…my hosting provider restricts what kind of files I can upload…TXT is not one of them.). The pages that I used as reference material, or that I copied code from can be found here, here, here, here, here, here, here and here.
Let me know if it helps or if you have suggestions of how to improve it.
Vista Reliability Monitor Stopped Working
One nice feature that I have enjoyed in Vista is the Reliability Monitor. (Press the Windows key and start typing “reliability” in the “start search” area on the Start Menu. Then click on Reliability Monitor.) This feature will give you a history of how stable/unstable your computer has been. It will list success and failures per day for each of the following categories:
-
Software Installs and Uninstalls
-
Application Failures
-
Hardware Failures
-
Windows Failures
-
Miscellaneous Failures
This is great for troubleshooting what is going right/wrong with a computer. In particular…have you ever asked a user whose computer is going nuts the question, “Have you installed anything recently?” Of course their answer is always, “No.” Well…open up Reliability Monitor to find out the real answer. Hmmm…it looks like right about the time you started having problems that you installed WeatherBug. “Oh yeah…I forgot about that one.”
I have been using Reliability Monitor to watch a couple of troublesome apps that I have running on my computer. I’ve watched my reliability index drop from 9+ down to a low of 2.92. I’m having issues with our corporate antivirus (Panda…stay away from it in my opinion.) as well as Covenant Eyes. CE worked great up until an update that they pushed out in mid-January. It’s been crashing a lot since then…frequent instances of nmSvc.exe stopping working. They had an incremental upgrade today…hopefully that will resolve the issues.
Anyway…I’ve been monitoring that, but when I checked the chart this morning, I noted that there had been no updates in the last seven days. Hmm…that’s odd…so I started digging. One of my first stops was to look at the System Event Log to see if there were any errors related to Reliability Monitor. Instead what I got was a message that it couldn’t read the data in the event log. For all appearances, it appeared that the event log is corrupt.
After choosing to clear the event log (without saving changes…it wouldn’t let me because of invalid data), I kicked off the RACAgent task (Task Scheduler, Task Scheduler Library, Microsoft, Windows, RAC…change view to show hidden tasks). When I went back into the Reliability Monitor I could now see the data for the last week.
That is a bit odd/frustrating…instead of reporting that in the monitor as an error, it gacked and hung the monitor.
Installing Vista Games via CMD Line
By default when you install Vista Business, it does not install the built in games (Chess Titans, Freecell, Hearts, Inkball, Mahjong Titans, Minesweeper, Purble Place, Solitaire, and Spider Solitaire). Many businesses like it that way and want to keep it that way. I don’t. If someone has a laptop and they want to play Chess or Solitaire at home…I don’t care…knock yourself out. What I don’t want is someone coming to me complaining that the games aren’t there. I want the games to be part of our default install. (Other admins can argue that point if they wish…that’s the decision I made for my environment.)
So…with my default install being completely driven by SCCM Task Sequences…I need to find a way to put that in a task sequence. In a Task Sequence, I need to be able to do this with a “Run Command Line” task. So…what is that command line?
First..it’s not easy to locate. I hunted way to long for this bit of info. I found other cryptic webpages about similar items, but nothing specifically addressing this one…imagine that…not many people want to install Vista’s games via the command line…who woulda thunk it? I finally figured it out through a bit of trial and error. That magic command line is:
pkgmgr.exe /iu:InboxGames /quiet
Note: “InboxGames” is case sensitive.
[Note: I have also found another command line for this: “ocsetup.exe InboxGames /quiet”. ]
What I would really like at this point is to have a command line way of uninstalling “Purble Place”. While I don’t mind if our staff play chess, solitaire, etc…I really don’t want them letting their kids play Purble Place on their work laptop. Anyone know how to do this?
Also…the way to point and click to do this is by opening up “Programs and Features” from the Control Panel, then clicking on “Turn Windows features on or off”, then checking the Games checkbox.
Build and Capture Task Sequence Failure
I have fought with this before and didn’t figure it out. Been fighting with it again and finally made an educated guess that has since been backed up by finding a thread to support my findings.
I created a Task Sequence in SCCM to “Build and capture a reference operating system image”. I am using the Vista SP1 DVD that I imported into Operating System Install Packages. It gets part of the way through the install, and then fails. By opening a command prompt on the machine running the Task Sequence (F8), I was able to look at the log files. In looking at the x:windowstempsmstslogsmsts.log log file, I saw an entry that stated “Windows Setup Failed, code 31”. That was followed by “Exiting with code 80004005“. Not a lot of help. Then I found the x:\windows\temp\smstslog\windowssetuplogs\setuperr.log log file. That contained the following lines:
Callback_Productkey_Validate: EditionID for product key was NULL.
Callback_Productkey_Validate: An error occurred writing the product key data to the blackboard.
Callback_Productkey_Validate_Unattend:Invalid product key; halting Setup.[gle=0x00000490]
Callback_Productkey_Validate_Unattend: An error occurred preventing setup from being able to validate the product key; hr = 0x80300006[gle=0x00000490]
Now…I know that my volume license product key is good. I’ve been using it for a long time. Just for grins I popped the Vista DVD in a spare computer and confirmed it. Why is it telling me the license key is invalid?
So here comes the educated guess. I modified the Task Sequence to not use a Product Key…just left that field blank. Hmmm…the install works perfectly fine. That led me to search on something different and find this thread. Basic gist is that if you are using a Task Sequence to install an OS using an Operating System Install Package, you should NOT specify a product key. Perhaps that is documented somewhere, but I haven’t seen it. It is however doggone frustrating to have wasted as much time as I have on this problem.