Collect SMART hard drive status in ConfigMgr inventory


Recently while working through preflight checks for Windows 10 (W10) Redstone 1607  deployment we realized there were some spinning platter drive failures.  To help identify potentially failing machines we were looking for the Hard Drive Smart status field.  Turns out it is not gathered by default in SCCM.  The following walks you through it.

WIN32_DiskDrive contains this info under the status field.  It does not appear to be enabled by default (might just be the environment I am looking at)

I would suggest ensuring that the following are enabled
• Caption
• Status
• Capabilities (Optional to see if bit 10 is set – SMART enabled)

PowerShell example

$wmi = gwmi -class win32_diskdrive
foreach($drive in $wmi){$drive.caption + “: ” + $drive.status}

WMIC Example

WMIC DiskDrive GET Caption,status

System Center Configuration Manager (SCCM) Current Branch (CB)

This status field is NOT collected by default in SCCM.  To have the Hardware Inventory Gather this information in your environment you must enable this class in Client Settings

  1. Open SCCM Console
  2. Select Administrator node (bottom Left)
  3. Select Client Settings (middle left)
  4. Select the Client Settings you want to modify.
    1. Best Practice is to create a policy and not use the Default Client Settings.  As this is my lab I did use Default Client Settings
    2. If you create a new one than you need Hardware Inventory
  5. Select Set Classes
  6. usmt-estimate-step
  7. Filter on Win32_DiskDrive
  8. Expand out the class then select Status field
  9. Ok
  10. Ok

If you changed the Default Client Setting it will automatically be sent out to every client in the environment.  The v_GS_Win32_DiskDrive view will be updated with the Status Field.  Use the Reference section below to understand what these values mean.  I also found this field is not being read but not sure where it is ConfigManagerErrorCode


Win32_DiskDrive class


Data type: string
Access type: Read-only
Qualifiers: MaxLen (10), DisplayName (“Status”)

Current status of the object. Various operational and nonoperational statuses can be defined. Operational statuses include: “OK”, “Degraded”, and “Pred Fail” (an element, such as a SMART-enabled hard disk drive, may be functioning properly but predicting a failure in the near future). Nonoperational statuses include: “Error”, “Starting”, “Stopping”, and “Service”. The latter, “Service”, could apply during mirror-resilvering of a disk, reload of a user permissions list, or other administrative work. Not all such work is online, yet the managed element is neither “OK” nor in one of the other states.

This property is inherited from CIM_ManagedSystemElement.

Values are:

OK (“OK”)

Error (“Error”)

Degraded (“Degraded”)

Unknown (“Unknown”)

Pred Fail (“Pred Fail”)

Starting (“Starting”)

Stopping (“Stopping”)

Service (“Service”)

Stressed (“Stressed”)

NonRecover (“NonRecover”)

No Contact (“No Contact”)

Lost Comm (“Lost Comm”)



USMT Estimate when really small should be set to a value of 1 during an SCCM OSD TS

Problem: USMT Estimate tool rounds to a value of Zero if the value is less than 1 meg


I have been playing with the User State Migration Tool (USMT) Estimate switch recently.   USMT Estimate has been around since 2008 at least.   I found a scenario where the size returned may be less than 1 meg but above zero.  However, the USMT estimate return apparently rounds down to zero and may cause issues.


During an OSD TS in SCCM you run a variation of the following command line

ZTIUserStateEstimate.wsf /USMTMigFiles001:MigApp.xml /USMTMigFile002:MigUser.xml

This populates a SCCM TS variable


Check out the free tool called TSEnv2.exe to read and modify variables on the fly (even hidden or protected ones)


Add a Set Taks Sequence Variable step to the TS just after the USMT Estimate step


  1. Task Sequence Variable = USMTEstimate
  2. Value = 1


On the Options Tab create a quick logic test.

  1. Add Condition
  2. Task Sequence Variable
  3. Variable = USMTEstimate
  4. Less than
  5. Value = 1


This will sort the issue of very small USMT data being dropped.  True it does force every machine to have at least one bit of backed up data but that is a minor concern if you have 1E Nomad Peer backup Assistant or SCCM State Migration Points everywhere.


Great Reference

Great script from Jason Sandys to add it to your HINV –


Windows Insider: 14946 doesn’t like 3rd party antivirus or encryption

1471524244-4735Heads up

Released this morning on Oct 13th 2016 if you have any of the following a very strong chance of in place upgrade trying then rolling back.  Surprised I don’t see McAfee a

  • Bitdefender, Kaspersky Antivirus, F-Secure Antivirus and Malwarebytes installed on your PC

Solution: Outlook (2007, 2010, 2013, O365) prompts me for credentials each time I open


When your IT administrators update their exchange server or you switch to a new DNS alias or up in the cloud windows adds these new Generic Credentials into the Credentials Vault of your user account.  When more than one exists for a single account Outlook gets confused and prompts you.


  1. Close Microsoft Office
  2. Windows 7 and before
    1. From the Windows Start button, select Control Panel
    2. Click User Accounts
    3. Click Credentials Manager
  3. Windows 8
    1. Start button
    2. Type in Windows Credentials Manager
    3. Select Settings on the left side
    4. Select  Windows Credentials Manager
  4. Windows 10
    1. Start Button
    2. Type in Credential Manager
    3. Select Windows Credentials
  5. In the Generic Credentials section (bottom)
    1. For local installs (not O365)
      1. You’re looking for credentials that begin MS.Outlook or something similar for your mail server (It will be obvious)
      2. For each credential that begins with MS.Outlook
        1. Click the details button drop down (circle with a downward arrow next to the Modified date)
        2. Click Remove
      3. Repeat steps for each credential that begins MS.Outlook
    2. O365
      1. You’re looking for MicrosoftOffice16_Data:SSPI:EMAIL@ADDRESS.COM
      2. This is your primary credentails this should be taken with great care upon removal as you will need to resync O365 again afterwards
  6. Close the Credentials Manager and Control Panel
  7. Launch Outlook
  8. You should be prompted for each account in Outlook
    1. You should only be prompted on this initial startup


Another fun tip to make outlook run better is to use the/CleanFreeBusy start up switch.

/cleanfreebusy Clears and regenerates free/busy information. This switch can only be used when you are able to connect to your Microsoft Exchange server. 2000, 2002/XP, 2003, 2007, 2010

The /CleanFreeBusy switch will reset all of your pending Outlook meeting invites.  This will clear any conflicts and again make Outlook faster.  This was deprecated for 2013.

For Office 2013, 2016, and O365 you use this:

Great Reference for Outlook Command Lines 

From a Post Mr.Brown

Make sure the time on all your servers is in sync. If the time on two of your domain controllers is off by more than 5 mins you will get this for some clients. It took me two days to narrow it down and once I fixed the time on one of my servers all the weirdness went away.

Query: Identify ConfigMgr (SCCM) collections based on Active Directory OU membership

The question came up recently on how to identify which collections are based on Active Directory OU membership in Microsoft System Center Configuration Manager (SCCM) Current Branch

There are tons of guides on how to setup a collection based on OU membership.. but now that you have.. how many have you created?

This is quite simple direct SQL query:

SELECT [CollectionID]
  FROM [SMS_ABC].[dbo].[v_CollectionRuleQuery]
  where QueryExpression like ‘%System_OU%’


*  not all collection memberships need to be based on System OU.  Varitations will be needed based on requirements

* The above query is based on a view.  If you want to see the SQL you would query the table Collection_Rules_SQL

Useful Tip

The SQL table Collection_Rules_SQL also has the WQL versions of the same query.  This is extremely useful for figuring out the SQL tables involved with any WQL query from collections or the Query node.  You can also get this translation from the SMSProv.log file but that is like searching for a needle in a hay stack while the hack stack is getting bigger and may disappear in a roll over.


A nice bit of documentation at Creating Custom Reports by Using SQL Server Views in System Center 2012 Configuration Manager

Otherwise, happy spelunking!

Music Library Cleaning with PowerShell – Removing Missing Files from iTunes


At the bottom of this post I originally wrote a VBS that deletes files out of ITunes if the location does not exist.  I did the rewrite into PowerShell…

(new-object –com itunes.application).LibraryPlaylist.Tracks | ?{ $_.Location -eq $null } | %{ $_.Delete() }


The PowerShell above only removes the item out of ITunes if the location is NULL.  I need to put in a step to check to see if the location is valid.

ITTrackKindFile = 1

deletedTracks = 0

on error resume next

set iTunesApp = WScript.CreateObject("iTunes.Application")

set mainLibrary = iTunesApp.LibraryPlaylist

set tracks = mainLibrary.Tracks

Set FSO = CreateObject("Scripting.FileSystemObject")

for each currTrack in tracks

	' is this a file track?

	if (currTrack.Kind = ITTrackKindFile) then

		' yes, does it have an empty location?

		if (currTrack.Location = "") 		then 

			' yes, delete it

			wscript.echo & " - " & currTrack.Location


			deletedTracks = deletedTracks + 1


			'wscript.echo currTrack.Location

			if not fso.fileExists(currTrack.Location) then

				wscript.echo & currTrack.Location


			end if	

		end if

	end if


wscript.echo "-----------------------------------------------------"

wscript.echo "deletedTracks = " & deletedTracks