Standalone Media Expiration Date
I'm relatively new to SCCM 2007 OSD after moving from service desk technician to systems administrator. One thing I'd like to provide my fellow technicians is a standalone DVD to perform bare metal installations while working at remote sites. One of our administrators previously created one, but the practice was discouraged when we started getting computers added to the domain with an image over 1 year old. So far I've been unable to find a good resource on how to configure standalone media to have an expiration date. I've got a decent theoretical method that I'm testing out, but I was wondering if anyone knew of an existing best practice?
July 22nd, 2010 9:01pm

There isn't anything built-in, you would have to do a custom solution. I've seen a few creative ones, but don't have any links handy.MCTS: ConfigMgr, MDT / http://myitforum.com/cs2/blogs/cnackers/default.aspx
Free Windows Admin Tool Kit Click here and download it now
July 22nd, 2010 10:00pm

Well my testing method appears to be working, although not exactly gracefully. I'd still like to see if anyone out there already made an elegant solution. Here's my overall process: I created a software package containing the vbscript below to check for a custom expiration date task sequence variable: OPTION EXPLICIT DIM osd: SET osd = CREATEOBJECT("Microsoft.SMS.TSEnvironment") DIM iExitCode DIM strCurrentDate: strCurrentDate = DATE() DIM strExpireDate: strExpireDate = osd("DVDExpirationDate") DIM strNoExpire: strNoExpire = "This standalone installation media was not configured with an expiration date. To prevent deployment of systems with old images, a valid expiration date must be configured. Please obtain new installation media from your system administrator." DIM strDVDExpired: strDVDExpired = "This standalone installation media was configured with an expiration date of "&strExpireDate&". To prevent deployment of systems with old images, installation is no longer permitted. Please obtain new installation media from your system administrator." DIM strDVDValid: strDVDValid = "This standalone installation media was configured with an expiration date of "&strExpireDate&". Installation is allowed through that date." IF strExpireDate = "" THEN MSGBOX strNoExpire, vbOKOnly+vbCritical, "Media Error" iExitCode = 1 ELSE IF DATEVALUE(strCurrentDate) > DATEVALUE(strExpireDate) THEN MSGBOX strDVDExpired, vbOKOnly+vbCritical, "Media Expired" iExitCode = 1 ELSE MSGBOX strDVDValid, vbOKOnly+vbInformation, "Media Valid" iExitCode = 0 END IF END IF WSCRIPT.QUIT(iExitCode) I then created a custom task sequence for the full deployment from standalone media. It was just our normal task sequence with the following added: Restart Computer in Windows PE (seems unecessary for a DVD but was there by default) Set Task Sequence Variable "DVDExpirationDate" to "07/21/2010" (for testing just to make sure it would expire) Run Command Line to call "DVDExpiration.vbs" specifying the package created earlier Do the rest of the image as normal... I set the command line to not continue on error. The annoying part of this is that after the expiration warning from the script, the techs will see the standard task sequence error dialog with the 15 minute countdown to restart. I would prefer to have it completely skip that message and just restart, or at least get it to display custom text. If I can't do that, I'll just have my script return code 195940700 (0x0BADD15C, HA!) instead of 1. This effectively halts the entire task sequence, which is pretty much the desired end state. Of course, since standalone media is not dependent on communicating with a server this method is vulnerable to simply changing the system time in BIOS. Anyone have any better ideas?
July 22nd, 2010 10:18pm

MSGBOX strNoExpire, vbOKOnly+vbCritical+vbSystemModal, "Media Error" Well my testing method appears to be working, although not exactly gracefully. I'd still like to see if anyone out there already made an elegant solution. Here's my overall process: I created a software package containing the vbscript below to check for a custom expiration date task sequence variable: OPTION EXPLICIT DIM osd: SET osd = CREATEOBJECT("Microsoft.SMS.TSEnvironment") DIM iExitCode DIM strCurrentDate: strCurrentDate = DATE() DIM strExpireDate: strExpireDate = osd("DVDExpirationDate") DIM strNoExpire: strNoExpire = "This standalone installation media was not configured with an expiration date. To prevent deployment of systems with old images, a valid expiration date must be configured. Please obtain new installation media from your system administrator." DIM strDVDExpired: strDVDExpired = "This standalone installation media was configured with an expiration date of "&strExpireDate&". To prevent deployment of systems with old images, installation is no longer permitted. Please obtain new installation media from your system administrator." DIM strDVDValid: strDVDValid = "This standalone installation media was configured with an expiration date of "&strExpireDate&". Installation is allowed through that date." IF strExpireDate = "" THEN MSGBOX strNoExpire, vbOKOnly+vbCritical, "Media Error" iExitCode = 1 ELSE IF DATEVALUE(strCurrentDate) > DATEVALUE(strExpireDate) THEN MSGBOX strDVDExpired, vbOKOnly+vbCritical, "Media Expired" iExitCode = 1 ELSE MSGBOX strDVDValid, vbOKOnly+vbInformation, "Media Valid" iExitCode = 0 END IF END IF WSCRIPT.QUIT(iExitCode) I then created a custom task sequence for the full deployment from standalone media. It was just our normal task sequence with the following added: Restart Computer in Windows PE (seems unecessary for a DVD but was there by default) Set Task Sequence Variable "DVDExpirationDate" to "07/21/2010" (for testing just to make sure it would expire) Run Command Line to call "DVDExpiration.vbs" specifying the package created earlier Do the rest of the image as normal... I set the command line to not continue on error. The annoying part of this is that after the expiration warning from the script, the techs will see the standard task sequence error dialog with the 15 minute countdown to restart. I would prefer to have it completely skip that message and just restart, or at least get it to display custom text. If I can't do that, I'll just have my script return code 195940700 (0x0BADD15C, HA!) instead of 1. This effectively halts the entire task sequence, which is pretty much the desired end state. Of course, since standalone media is not dependent on communicating with a server this method is vulnerable to simply changing the system time in BIOS. Anyone have any better ideas? This worked very well for me. The only change I had to make was to add the change the "vbSystemModal" option to the MSGBOX call. This ensure that the message box will appear over top of the Config Manager Task Sequence Window. E.G. MSGBOX strNoExpire, vbOKOnly+vbCritical+vbSystemModal, "Media Error"
Free Windows Admin Tool Kit Click here and download it now
May 11th, 2011 4:40pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics