Jump to content


mcbroome

Established Members
  • Content Count

    11
  • Joined

  • Last visited

Community Reputation

0 Neutral

About mcbroome

  • Rank
    Member
  1. ok, I removed the exit code and changed "Command = TEMPDIR & "\scripts\Shutdown.exe /s /t 0" " to : Command = "\windows\temp\Shutdown.exe /s /t 0" after copying and pasting shutdown.exe into that path of my mounted boot.wim. I'll commit, recompile and give it a whirl.....wish me luck!
  2. is the %tempdir%\Scripts folder supposed to be :;\windows\temp\scripts\shutdown.exe ? Making that change to the script. Im diging thru the usb media and cant find shutdown.exe...........
  3. Ok, following the instructions exactly on the guide located here: http://blogs.technet...lone-media.aspx my tsconfig.ini reads as: [CustomHook] CommandLine=”cscript.exe X:\ExpiredUFDCheck.vbs” the .vbs at the root of my boot image is as follows: ' // *************************************************************************** ' // ' // File: ExpiredUFDCheck.vbs ' // ' // Version: 1.0 ' // ' // Purpose: Check to see if stand-alone media is expired ' // ' // Usage: cscript ExpiredUFDCheck.vbs ' // ' // *************************************************************************** On Error Resume Next ' // --------------------------------------------------------------------- ' // Find the environment variable %configpath% for location of UFD ' // --------------------------------------------------------------------- 'Set objShell = CreateObject("WScript.Shell") 'Set objExecObject = objShell.Exec("%comspec% /c echo %configpath%") 'configPath1 = objExecObject.StdOut.ReadAll() 'configPath = Mid(configPath1, 1, Len(configPath1) -2) ' // ----------------------------------------------------------------------------------------- ' // Find the environment variable %TEMP% for location of tool files (e.g. shutdown.exe) ' // ----------------------------------------------------------------------------------------- Set objShell = CreateObject("WScript.Shell") Set objExecObject = objShell.Exec("%comspec% /c echo %temp%") temp = objExecObject.StdOut.ReadAll() tempdir = Mid(temp, 1, Len(temp) -2) ' // --------------------------- ' // Find driver letter for UFD '// ---------------------------- Set FSO = CreateObject("Scripting.FileSystemObject") Set Drives = FSO.Drives For Each DiskDrive In Drives If DiskDrive.DriveType = "1" Then USBPath = DiskDrive.Path End If Next ' // ----------------------------------------------------------------- ' // Query WMI for creation date of the Policy.xml file on the UFD ' // ----------------------------------------------------------------- strComputer = "." Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") ' // ---------------------------- ' // Media Check - Policy.xml ' // ---------------------------- Set colFiles = objWMIService.ExecQuery("Select * From CIM_DataFile Where Name = '" & USBPath & "\\SMS\\Data\\Policy.xml'") ' // ----------------------------------------- ' // Set the date 3 months ago from today ' // ----------------------------------------- dt3MonthsAgo = DateAdd("m", -3, Now) ' // ----------------------------------------------------------------------------------------------------------- ' // If the Policy.xml file creation date is less than the date 3 months ago from today, it is an expired UFD. ' // ----------------------------------------------------------------------------------------------------------- For Each objFile in colFiles dtCreationDate = WMIDateStringToDate(objFile.CreationDate) dtEndDate = DateAdd("m", 3, dtCreationDate) If dtCreationDate < dt3MonthsAgo then Set WshShell = CreateObject("WScript.Shell") Command = TEMPDIR & "\scripts\Shutdown.exe /s /t 0" MsgBox "This task sequence expired on " & dtEndDate, vbMsgBoxSetForeground, "Expired Task Sequence" Set oExec = WshShell.Exec(Command) Else WScript.Quit(1) End If Next ' // ----------------------------------------------------------------------------------------- ' // Converting the WMI date query response to a simple date format. (e.g. 09/21/2010) ' // ----------------------------------------------------------------------------------------- Function WMIDateStringToDate(dtmInstallDate) WMIDateStringToDate = CDate(Mid(dtmInstallDate, 5, 2) & "/" & Mid(dtmInstallDate, 7, 2) & "/" & Left(dtmInstallDate, 4) & " " & Mid(dtmInstallDate, 9, 2) & ":" & Mid(dtmInstallDate, 11, 2) & ":" & Mid(dtmInstallDate, 13, 2)) End Function I set the bios to have the following date: 7/18/13 when I boot from the standalone usb key, I get this: on pressing "ok" the machine is SUPPOSED to shut down. Instead the expiration notice disappears and I can hit "next to execute the task sequence. The workstation is not shutting down when "ok" is pressed. When I change the Bios to make the Task Sequence valid, it throws an 8005 error becasue of "WScript.Quit(1)" at the end of the script. Thank you for the help in advance!!!!
  4. following the instructions here: http://blogs.technet.com/b/deploymentguys/archive/2012/02/15/expiring-outdated-stand-alone-media.aspx my tsconfig is as follows: [CustomHook] CommandLine="cscript.exe X:\ExpiredUFDCheck.vbs" CommandLine="wscript.exe X:\Deploy\Scripts\ZTIMediaHook.wsf" The ORIGINAL vbs file is as follows, which will not function for me and just throw errors and the logic seems wrong so I corrected it, ( changes annotated). On Error Resume Next ' // --------------------------------------------------------------------- ' // Find the environment variable %configpath% for location of UFD ' // --------------------------------------------------------------------- 'Set objShell = CreateObject("WScript.Shell") 'Set objExecObject = objShell.Exec("%comspec% /c echo %configpath%") 'configPath1 = objExecObject.StdOut.ReadAll() 'configPath = Mid(configPath1, 1, Len(configPath1) -2) ' // ----------------------------------------------------------------------------------------- ' // Find the environment variable %TEMP% for location of tool files (e.g. shutdown.exe) ' // ----------------------------------------------------------------------------------------- Set objShell = CreateObject("WScript.Shell") Set objExecObject = objShell.Exec("%comspec% /c echo %temp%") temp = objExecObject.StdOut.ReadAll() tempdir = Mid(temp, 1, Len(temp) -2) ' // --------------------------- ' // Find driver letter for UFD '// ---------------------------- Set FSO = CreateObject("Scripting.FileSystemObject") Set Drives = FSO.Drives For Each DiskDrive In Drives If DiskDrive.DriveType = "1" Then USBPath = DiskDrive.Path End If Next ' // ----------------------------------------------------------------- ' // Query WMI for creation date of the Policy.xml file on the UFD ' // ----------------------------------------------------------------- strComputer = "." Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") ' // ---------------------------- ' // Media Check - Policy.xml ' // ---------------------------- Set colFiles = objWMIService.ExecQuery("Select * From CIM_DataFile Where Name = '" & USBPath & "\\SMS\\Data\\Policy.xml'") ' // ----------------------------------------- ' // Set the date 3 months ago from today ' // ----------------------------------------- dt3MonthsAgo = DateAdd("m", -3, Now) ' // ----------------------------------------------------------------------------------------------------------- ' // If the Policy.xml file creation date is less than the date 3 months ago from today, it is an expired UFD. <---------Shouldnt this be MORE? ' // ----------------------------------------------------------------------------------------------------------- For Each objFile in colFiles dtCreationDate = WMIDateStringToDate(objFile.CreationDate) dtEndDate = DateAdd("m", 3, dtCreationDate) If dtCreationDate > dt3MonthsAgo then <--------------- I have changed "<" to ">" Set WshShell = CreateObject("WScript.Shell") Command = TEMPDIR & "\scripts\Shutdown.exe /s /t 0" MsgBox "This USB Key expired on" & dtEndDate, vbMsgBoxSetForeground, "Expired USB Media" Set oExec = WshShell.Exec(Command) Else 'WScript.Quit(1) <------------------I have commented this out, ts fails every time, throwing a 4005 error End If Next ' // ----------------------------------------------------------------------------------------- ' // Converting the WMI date query response to a simple date format. (e.g. 09/21/2010) ' // ----------------------------------------------------------------------------------------- Function WMIDateStringToDate(dtmInstallDate) WMIDateStringToDate = CDate(Mid(dtmInstallDate, 5, 2) & "/" & Mid(dtmInstallDate, 7, 2) & "/" & Left(dtmInstallDate, 4) & " " & Mid(dtmInstallDate, 9, 2) & ":" & Mid(dtmInstallDate, 11, 2) & ":" & Mid(dtmInstallDate, 13, 2)) End Function I"m going crazy trying to get this thing to work! No matter what date I set in the bios, i see the script kick off, but my task sequence keeps right on going . Won't running this with the cscript command open an ugly to the end user cmd prompt box along with the notification box? Any help is appreciated!
  5. Ok folks Im going nuts! I cant seem to get the xcopy working! I have tried the following with no luck: xcopy *%systemdrive%\USMTbits /herciy xcopy %_SMSTSabc12345%* %USMTDrive%\USMTbits /herciy (changing abc12345 to my package number) xcopy %_SMSTSP0200201%\x86\* %systemdrive%\USMTbits /herciy xcopy * %systemdrive%|USMTbits\X86 /herciy Any ideas folks?
  6. We are already using a .vbs script along with a status filter to remove pc's from osd collections when the task sequence completes. On our "Barebones/pre-load collection" this isnt working because it never triggers the task sequence success code in the event log. Does anyone know how to remove machines from a collection automatically if they DO have a client? Thanks in advance!!!!!
  7. I've been hunting around for a few days and can't seem to find a script for this. My barebones/preload collection needs constant daily cleaning on units that now have the client on them. Does of anyone know of a script that can run at specified intervals and remove any workstations that are showing the client present? We are running 2007 R3. Of course I would have to make this OSD collection dynamic for it to work, but with an osd collection, that shouldn't be a problem/burden on the system. I already have most of my osd collections self cleaning when machines throw a task sequence success code at the management point, but for some reasons barebones and preloads aren't throwing the necessary success code out to trigger my existing script. Any help is appreciated!
  8. Does anyone know of a method to track what users are doing in the sccm console? I am faced with turning console over to my companies technicians and even though their security rights are clamped down, I need to see who does what, when and to what. Anyone know of a script, service or program that will does this? Much Appreciated!
  9. This error started yesterday afternoon and I have been troubleshooting since. I can try to deploy either win 7 or win xp with the same results. The task sequence kicks off, reboots into WinPE. The hard link data capture starts, succeeds and it starts to apply the operating system. Here's my problem, it isn't finding the operating system .wim on the osd share even tho the console shows very clearly it is there, updated on the DP's and specified in the task sequence! I have checked that the data path is correct and all of the other packages for the task sequence are present and updated. I have atached the logfile, any help would be greatly appreciated! We are running R3 on 2008 r2 with the advanced client. smsts-20110526-111957.log
×
×
  • Create New...