Latest Event Updates

RDP impacts the “Run Advertised Programs” applet

Posted on Updated on

I have been struggling with a problem all day that, when I was inches from giving up, I found the cause and the workaround.  Thought I’d share it too.

Sometimes it is necessary to not force a mandatory start time for an SMS/SCCM advertisement, but intead to allow the end-user to manually trigger the advertisement/program from the control panel applet “Run Advertised Programs”.  The situation was that, for all servers within the targeted collection (only 4 servers total), the Run Advertised Programs applet was blank.  And there was no “New Program Available” system tray icon.  I tried everything from different Program settings, different Advertisement settings, reviewed the Advertised Programs Client Agent, collection settings, etc etc etc.

After taking a short break to play company softball, I came back to the office to practiced my Google-foo skills.  I stumbled upon a forum posting about RDP interfering with the applet.  With my fingers crossed, I launched RDP in admin mode (e.g. mstsc /admin), logged into the server, launched the Run Advertised Program applet, and voila …there was my advertisement.

Hopefully one day I’ll find the solution and update this post…or maybe someone will read it who already knows the solution!

Advertisements

Script to Disable HP Fingerprint Device

Posted on Updated on

This VBScript is for disabling the Fingerprint device in BIOS.  It has only been tested on a few newer HP models.

'==========================================================================
' AUTHOR: Nick Moseley , https://t3chn1ck.wordpress.com
' DATE  : 5/29/2009
' COMMENT: This script is for disabling the Fingerprint Device in BIOS
' It has been tested on HP models - 6515b, 6535b, 2510p - but may
' function for other models
'==========================================================================
Option Explicit
Const ForAppending = 8
Const wbemFlagReturnImmediately = 16
Const wbemFlagForwardOnly = 32
Dim oFSO, oFile, oWMI_BIOSSettingInterface, oItem, colItems, lFlags, iReturnValue 
 
' Open Log File
Set oFSO = CreateObject("Scripting.fileSystemObject")
Set oFile = oFSO.OpenTextFile ("C:\DisableFingerprintDevice.txt", ForAppending, True)
 
' Query WMI
lFlags = wbemFlagReturnImmediately + wbemFlagForwardOnly
Set oWMI_BIOSSettingInterface = GetObject("winmgmts:{impersonationlevel=impersonate}//./root/HP/InstrumentedBIOS")
Set colItems = oWMI_BIOSSettingInterface.ExecQuery("select * from HP_BIOSSettingInterface",,lFlags) 
 
' Configure Fingerprint Device to be disabled
For Each oItem In colItems 
  oItem.SetBIOSSetting iReturnValue, "Fingerprint Device", "Disable"
Next 
 
' If change was successful (exit code 0) then log
If iReturnValue = 0 Then
 WScript.Echo "Completed with: " & iReturnValue
 oFile.WriteLine "Disabled Fingerprint Device in BIOS (" & Date & " " & Time & ")"
Else
 oFile.WriteLine("FAILURE: Could not disable Fingerprint Device, option not found in BIOS (" & Date & " " & Time & ")")
End If 
 
oFile.Close
WScript.Quit ()

Repairing WMI Repository

Posted on Updated on

When troubleshooting WMI on SMS/SCCM clients, I’ve frequently used the following command to attempt a repair of the WMI repository.  I don’t recall where I found it (several years ago), but I also don’t want to ever forget it!

  1. Open a command prompt
  2. Change to directory C:\Windows\system32\wbem\
  3. Run: for /f %s in (‘dir /b *.mof *.mfl’) do mofcomp %s

wmi_repair

HTA BackEnd Script for OSD

Posted on Updated on

This post has been updated with new code. 

Please visit OSD Options Chooser v2

There are plenty of examples out there for how to get the most out of Task Sequences for SCCM 2007 OS deployment.  But I wasn’t motivated to find out how others were doing it…Until I saw a demonstration by Jarvis Davis that he presented at MMS 2009. 

From that I built my own custom HTML Application to do what I needed.  At the moment, I have not enabled HTA support in my WinPE boot images.  So the below example is purely a “BackEnd” script which simply means that it needs to run at the towards the end of the Task Sequence so that the end-operator (or end-user) does not need to wait for much of the imaging to complete.

This HTA does the following

  • Field to enter in the name of user to add into the local Administrators group
  • Selection for US time zone to configure Windows to use (defaults to MST, since that is where I am)
  • Option to install one of 6 flavors of Adobe Acrobat
  • Option to install one of 2 flavors of Project 2003
  • Option to install one of 2 flavors of Visio 2003
  • Option to install BlackBerry desktop
  • Option to install Streets and Trips 2006

Additional things to note

  • In order to add a domain user to your local admins group, the value sDomainName = “YourDomainName” must be filled in appropriately.
  • All activity is logged into C:\CustomSystemOptions.log
  • If one of the options to install software is selected, a Task Sequence variable is created and set to True.  To utilize this, you would need to have an Install Software task that is limited to only install of the corresponding variable is set to True.  Note: the Install Software task must be after the execution of the HTA!

List Systems with Bad MIFs

Posted on Updated on

Today I was troubleshooting some client communication problems and found that one of the causes was that they were generating bad MIFs, so SCCM was rejecting the hardware inventory they were sending.  Along the way, I also found that there 230 bad MIFs on my site server.  Instead of manually opening each file to ‘document’  which system it was, I decided to script it.  I must give credit to a blog posting by Don Hite, which gave me the original idea to do this in the first place.

'==========================================================================
' NAME   : Get_BADMIFS
' AUTHOR : Nick Moseley, https://t3chn1ck.wordpress.com
' DATE   : 5/14/2009
' UPDATE : 10/29/2014 - Added code to output the SMS Unique Identifier
' COMMENT: Ensure the value for sSMSInbox is the UNC path to your SCCM inboxes
'==========================================================================
Const ForReading = 1
Dim sSMSInbox, sNamePosition, bNameFound, sFileLine, sSystemName, iFileCount, oExcel, iRow
sSMSInbox = "\\ServerName\SMS_xyz\inboxes"
Set oShell = CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oBadDDRFolder = oFSO.GetFolder(sSMSInbox & "\ddm.box\BAD_DDRS")
Set cBadDDRFiles = oBadDDRFolder.Files
Set oBadMIFFolder = oFSO.GetFolder(sSMSInbox & "\auth\dataldr.box\BADMIFS")
Set colBadMIFFiles = oBadMIFFolder.Files
Set oExcel = CreateObject("Excel.Application")

' Create Excel Spreadsheet and Header
oExcel.Visible = True
Set oWorkbook = oExcel.Workbooks.Add
Set oWorksheet = oWorkbook.Worksheets(1)
iRow = 1
oExcel.Cells (iRow,1) = "System Name"
oExcel.Cells (iRow,2) = "File Name"
oExcel.Cells (iRow,3) = "File Date"
oExcel.Cells (iRow,4) = "File Size (MB)"
oExcel.Cells (iRow,5) = "SMS Unique ID"
' End Create

iFileCount = 0
For each oFile In colBadMIFFiles
    iFileCount = iFileCount + 1
    iRow = iRow + 1
    Set oMIFFile = oFSO.OpenTextFile (oFile.Path, ForReading, True)
	
    bNameFound = False
    Do Until bNameFound
        sFileLine = CStr (oMIFFile.ReadLine)
        sNamePosition = InStr (sFileLine, "<NetBIOS Name>")
        If sNamePosition > 1 Then
            sSystemName = Replace (Right (sFileLine, len(sFileLine) - (sNamePosition+14)), ">", "")
            sFoundBug = InStr (sSystemName, "//Client")
            If sFoundBug > 0 Then
                ' This is to fix a bug in the script which is undetermined
                ' Do Nothing
            Else
                oExcel.Cells (iRow,1) = sSystemName
                oExcel.Cells (iRow,2) = oFile.Name
                oExcel.Cells (iRow,3) = oFile.DateLastModified
                oExcel.Cells (iRow,4) = (oFile.Size/1024)/1024
                bNameFound = True
            End if
        End If
    Loop
    oMIFFile.Close
	
    Set oMIFFile = oFSO.OpenTextFile (oFile.Path, ForReading, True)
	bGuidFound = False
    Do Until bGuidFound
        sFileLine = CStr (oMIFFile.ReadLine)
        sNamePosition = InStr (sFileLine, "UniqueID")
        If sNamePosition > 1 Then
            sGUID = Replace (Right (sFileLine, len(sFileLine) - (sNamePosition+8)), ">", "")
                oExcel.Cells (iRow,5) = sGUID
                bGuidFound = True
        End If
    Loop	
    oMIFFile.Close
Next

oExcel.Range("A1:E1").Select
oExcel.Selection.Interior.ColorIndex = 19
oExcel.Selection.Font.ColorIndex = 11
oExcel.Selection.Font.Bold = True
oExcel.Cells.EntireColumn.AutoFit
oExcel.Cells.HorizontalAlignment = -4131
Set oExcelRange = oWorksheet.UsedRange
Set oExcelRangeA1 = oExcel.Range("A1")
oExcelRange.Sort oExcelRangeA1, 1, , , , , , 1
WScript.Echo "File Count: " & iFileCount

Also, see a great post by Nick Aquino detailing how bad mifs come to exist – http://myitforum.com/myitforumwp/2011/11/07/badmif-processing-when-a-client-doesnt-report-hardware-inventory/

Web Report for Software Updates Compliance

Posted on Updated on

SCCM doesn’t have a precreated report (that I can find) that quickly shows the patch compliance for a group of systems.  So I created one for myself, that I thought I’d share with every one.  To implement this, create a web report as you normally would; use the following SQL statement and remember to create a prompt with the information below that!

SQL Statement

select distinct sys.Name0, ui.BulletinID as BulletinID, ui.ArticleID as ArticleID, ui.Title as Title
from v_UpdateComplianceStatus css
join v_UpdateInfo ui on ui.CI_ID=css.CI_ID
join v_R_System sys on css.ResourceID=sys.ResourceID
join v_ClientCollectionMembers ccm on ccm.ResourceID=sys.ResourceID
where css.Status=2 and ccm.CollectionID=@CollID
order by sys.Name0, ui.ArticleID

Prompts

Name: CollID
Prompt text: Collection ID
Provide a SQL statement:

begin  if (@__filterwildcard = '')
select CollectionID as CollectionID, Name as CollectionName
from v_Collection
order by Name
   else
   select CollectionID as CollectionID, Name as CollectionName
   from v_Collection
   WHERE CollectionID like @__filterwildcard or Name like @__filterwildcard
   order by Name end

Scripting HP SoftPaqs

Posted on Updated on

Ever needed to know how to silently install an HP SoftPaq?  I recently needed to figure out the switches for approximately 75 individual SoftPaqs.  Fortunately, HP has standardized the switch to extract the setup files from the InstallShield executable.

  1. From a command line, simply call the .exe with /s to perform a silent extraction.
    Note: In some cases, no additional switches will be necessary and InstallShield will pass to the setup program the command to silently install.  If this is the case, then mark this as the only install switch you need.
  2. Change the working directory to where the files were just extracted.
  3. Do a directory list to find the name of the setup file, which will likely be Setup.exe
  4. Discover the switches that will work for that setup program.  This could be anything of the following
    • /s
    • /silent
    • -s
    • /q
    • /S /v/qn
    • /k – This is switch is very common for ATI Graphics controllers!
  5. Once you have found the silent install switches for the setup program, then you’re final switches become /s /a /SetupSwitch(es)

For BIOS related SoftPaqs, I find that it’s easiest to extract all of the files and then run HPQFlash.exe -s