DISM : Misc. WIM Management Commands

DISM.exe (Deployment Image Servicing and Management) is a command-line tool that can be used to service a Windows image or to prepare a Windows Preinstallation Environment (Windows PE) image.  DISM can be used to service a Windows image (.wim) or a virtual hard disk (.vhd or .vhdx). Clean old mountpoints • Dism /cleanup-wim Mount-Image • Dism /Mount-Image /ImageFile:C:\DISM\myimage.wim /index:1 /MountDir:C:\DISM\offline Add-Package • Dism /Add-Package /Image:C:\test\offline\Windows /PackagePath:C:\MSU\Windows10-KBxxxxxxx-x64.msu /LogPath:AddPackage.log Add Driver • DISM /Image:C:\test\offline /Add-Driver /Driver:C:\test\PS2x64 /recurse • DISM /Image:C:\test\offline /Add-Driver /Driver:C:\test\PS2x64\.inf Unmount-Image • Dism /unmount-image /mountdir:c:\test\offline /commit Enable Windows Feature •…

Read More

SQL Query : All Win10 Machines with User Details / OS Ver / OS LangID

Use this query to list all Windows 10 devices including the user, the OS version and the OS language ID. SELECT DISTINCT dbo.v_R_System.Name0 AS MachineName,     dbo.v_R_System.User_Domain0 AS UserDomain,     dbo.v_R_System.User_Name0 AS UserName,     dbo.vSMS_R_System.operatingSystemVersion0 AS OSVersion,     dbo.v_GS_OPERATING_SYSTEM.OSLanguage0 FROM dbo.v_R_System     INNER JOIN dbo.v_GS_COMPUTER_SYSTEM ON dbo.v_GS_COMPUTER_SYSTEM.ResourceID = dbo.v_R_System.ResourceID     INNER JOIN dbo.v_GS_OPERATING_SYSTEM on dbo.v_GS_OPERATING_SYSTEM.ResourceID = dbo.v_R_System.ResourceID     INNER JOIN dbo.vSMS_R_System ON dbo.v_R_System.Name0 = dbo.vSMS_R_System.Name0 WHERE vSMS_R_System.Operating_System_Name_and0 like ‘%Workstation 10%’ order by v_R_System.Name0 Sample Output

Read More

SQL Query : All Computers Missing a Specific KB Update

If you identify a software update which has been applied to a limited number of your devices, this query can be used to identify those where the KB is missing. select sys.name0 [Computername], osd.OSLanguage00 [OS Language], osd.Caption00 [OS Name] from v_updateinfo ui inner join v_UpdateComplianceStatus ucs on ucs.ci_id=ui.ci_id join v_CICategories_All catall2 on catall2.CI_ID=UCS.CI_ID join v_CategoryInfo catinfo2 on catall2.CategoryInstance_UniqueID = catinfo2.CategoryInstance_UniqueID and catinfo2.CategoryTypeName=’UpdateClassification’ join v_R_System sys on sys.resourceid=ucs.resourceid join Operating_System_DATA osd on sys.ResourceID = osd.MachineID and ucs.status=’2′ — required AND ui.articleid=’3012973′ order by sys.name0 Sample Output  

Read More

SQL Query : Systems With Hardware Scan > 60 Days ago

You can identify devices which have not checked in for some time, or those with potentially faulty SCCM clients using this query.  SELECT a.ResourceID, a.Netbios_name0, b.LastHWScan FROM v_R_System a INNER JOIN v_GS_WORKSTATION_STATUS b ON a.ResourceID = b.ResourceID WHERE b.LastHWScan <= Dateadd(day, -60, getdate()) order by LastHWScan desc Sample Output    

Read More

MDT : OSD Error Messages

These are just a few of the error messages I’ve seen during the MDT boot phase of OS build. 0x80040005 Error retrieving policy (check for expired cert on boot media or retry) 0x80070490 Unable to find disk partition to write to – clean disk with diskpart 0x8007000F Failed to prepare the system partition for staging – wrong build media? 0x80070005 Check date and time 0x80070035 Network path not found 0x80070057 Set variable for format and partition disk to OSDisk 0x80280803 TPM not enabled 0x80072EE7 Unknown host (network?) 0x80091007 downloaded package…

Read More

WMI : Useful WMIC Queries

The wmic command can be used to interrogate the local WMI repository.  The following queries return hardware related information. Check total RAM wmic MEMORYCHIP get BankLabel,DeviceLocator,Capacity,Tag Check computer model / service tag Wmic csproduct list /format Check CPU Wmic cpu get name There are many other parameters for this command listed here … https://ss64.com/nt/wmic.html  

Read More