SQL Query for Missing Task Sequence Packages on a Distribution Point

I’ve seen a lot of SQL queries over the years for finding missing Task Sequence packages on a Distribution Point, and never got one to work.

All I wanted to do was query a server name and a task sequence package ID to find out what applications or packages referenced by the TS still need to be distributed.

I finally actually got one to work (SQL isn’t my strongest area) so I thought I’d share with everyone:

SELECT DISTINCT TSR.PackageID,
PS.PackageID,
PSD.Name
 
FROM v_TaskSequencePackageReferences AS TSR
 
JOIN v_PackageStatus AS PS ON TSR.RefPackageID= PS.PackageID
JOIN v_PackageStatusDetailSumm AS PSD ON TSR.RefPackageID= PSD.PackageID
 
WHERE TSR.PackageID='<TSPACKAGEID>' AND PS.PackageID NOT IN (SELECT
PS.PackageID FROM v_PackageStatus AS PS 
JOIN v_TaskSequencePackageReferences AS TSR ON PS.PackageID= TSR.RefPackageID 
WHERE PS.PkgServer LIKE '%<SERVERNAME>%')

Replace <TSPACKAGEID> with the Task Sequence’s unique Package ID and <SERVERNAME> with the hostname of the Distribution Point you want to query.

Also anyone who is familar with the ‘Create Task Sequence Media’ wizard, you can use that to check what servers are missing packages as you get a listing of servers and the number of packages from the TS that it has. Good starting point to find DPs that have missing packages.

 

Failed to Run Task Sequence (0x87D00267)

Symptoms

Error can be seen inside of SCCM WinPE, after attempting to install an Application.

If you check the SMSTS.Log file you see an error similar to the following:

Failed to run the last action: Install HP Hotkey Support. Execution of task sequence failed.

Download failed (Error: 87D00267; Source: CCM)

Cause

This error can occur on computers with an SSD for the system drive and connected on a 100Mbps LAN connection for OS Deployment. This also only occurs for applications and not packages.

Resolution

Moving the computer onto a 1Gbps LAN connection resolved the issue in my case.  Alternatively people have had success with adding a 5 minute delay before installing an application.

The software change returned error code 0x652(1618)

This is an annoying error I see quite a bit when deploying software:
0x652(1618)

Error 1618 normally means the Windows Installer is busy running another installation.

Check that no other installations are running, otherwise try rebooting the computer and run the installation again, it should work this time.

If it is coming up as part of a task sequence, it might be worth adding a reboot before this application installation kicks off just to clear everything up.

 

Cannot Edit Object, which is in use by “Domain\Username” at Site “Site”

You can sometimes receive this error when the console crashes while you were in the middle of working on something.

To clear the lock, you need to remove it from the back end database.

  1. Open up SQL Management Studio
  2. Right click the SCCM Database and Click New Query
  3. Execute the query Select * from SEDO_LockState
    Lockstate1
  4. Search for the LockState, which can be located with the AssignedUser column and LockStateID = ‘1’
  5. Note down the ID of that row (eg 16778622)
  6. Execute the query delete from SEDO_LockState where ID=‘16778622’
    Lockstate2
  7. You will receive a message saying (1 row(s) affected)
  8. Check that row is removed by executing Select * from SEDO_LockState
  9. You’re done!

System Center 2012 Configuration Manager Support Tool

The ever frustrating task of troubleshooting SCCM 2012 Client Issues has been just made a lot easier.

Microsoft have just released the System Center 2012 Configuration Manager Support Tool, which looks fantastic for troubleshooting client issues.

There is an array of options for client monitoring and log reading included, as well as triggers to invoke many actions with the client.

And all packaged in a nice MSI for easy application deployment!

The download link can be found here:

http://www.microsoft.com/en-us/download/details.aspx?id=42645

 

SCCM OSD Task Sequence Log (smsts.log) Locations

Log File Locations

Below are the locations the smsts.log file will be in depending on the stage you are at. The best tool to use to view the log files is the Configuration Manager Trace Log Tool (cmtrace.exe). It can be found on an SCCM Site Server under %SCCMInstallLocation%\tools\

During OS Deployment

C:\smstslog\
(Common location)

Before your hard drive is formatted and partitioned

X:\windows\temp\smstslog\

After your hard drive is partitioned formatted

X:\smstslog\ and then is in C:\_SMSTaskSequence\logs\smstslog\

Within Windows

Within Windows before the SCCM agent is installed:

C:\_SMSTaskSequence\logs\smstslog\

Within Windows after the SCCM agent installed:

C:\windows\ccm\logs\smstslog\
(Common location)

When the Task Sequence completes

C:\windows\ccm\logs\

How to access and review the log files

From within Windows

If you can boot into Windows, it is easy to locate the log files with Windows Explorer.

From within WinPE (during OS Deployment)

To gain access to the log files in WinPE, you need to use command line.

  1. To bring up a command prompt, press F8
    smstslogfilelocation1
  2. Map a network drive to copy the log to, for example
    1. net use s: \\Server\Share
    2. enter your username like Domain\username
    3. enter your password
  3. Change the current directory to the log file location
    1. cd x:\windows\temp\smstslog  (See possible log file locations above)
    2. Type dir and press Enter, ensure there is a file called smsts.log there
      smstslogfilelocation2
    3. If the folder or file does not exist, try another directory mentioned at the start of this document.
  4. Once the log has been found, copy it to the network drive location
    1. copy smsts.log s:

The log can then be reviewed with the Configuration Manager Trace Log Tool from your computer.

Failed to Run Task Sequence (0x80004005)

Symptoms

Error can be seen inside of SCCM WinPE, after the Hard Drive is formatted/partitioned when you are trying to deploy a Windows 7 image.

Blog_16-06-14_1

If you check the SMSTS.Log file you see System Partition Not Set:

Blog_16-06-14_2

Additionally near the start of SMSTS.log, you see UEFI mode set to True:

Blog_16-06-14_3

Cause

The Task Sequence does not support Hard Disks configured UEFI mode, commonly found on computers shipped with Windows 8 pre-loaded.

Resolution

From within the BIOS of the computer, configure the Hard Disk to run in Legacy Mode rather than UEFI Mode. You may need to disable the UEFI devices from the boot order menu as well.

 

PXE Boot Aborted

Symptoms

Error appears when you try to PXE boot a computer, resulting in abortpxe or PXE Boot Aborted.

abortpxe

Checking SMSPXE.log on the Distribution Point, it reads something like

no advertisements found
No boot action. Aborted.

Cause

SCCM has no task sequences advertised to this computer.

Resolution

For computers straight ‘out of the box’, ensure you have a task sequence deployed to the Unknown Computers collection, and that it is enabled for PXE Clients.

For computers known by SCCM, if you have a specific Collection for deploying computers make sure the computer is a member of that Collection. Otherwise, check your Task Sequence deployment configuration to ensure it is enabled for PXE Clients. If you do not use a specific Collection for deploying images other than the Unknown Computers Collection, delete the computer from SCCM for the advertisement to be picked up.