SCCM Capture Process: Sysprep Error 0x00004005

In Windows 10 images are pre-installed some apps. Start to capture a reference image with SCCM and then , in the step of Sysprep process shows this: Error 0x00004005.

Execute this command powershell with Administrator rights Console:

Get-AppxPackage -AllUsers | Remove-AppxPackage

This command uninstall all apps.

Once Finished, try again to ejecute the capture process.

 

 

 

Advertisements

SCCM Console Custom Right Click

I found this article about how to customize your SCCM console with custom Actions.

Following the example you can customize your console with all actions that you need. I used to use Intel vPro AMT controls like Reboot, Power on and Power of actions in Collections and after upgrading to SCCM 2012 1702 i lost all this functions becuase Out of Band role disappeared and i want to still using this types of actions.

I had to install the AMT Addons for powershell from Intel Support web .

https://blogs.technet.microsoft.com/neilp/2012/03/18/long-live-right-click-tools-system-center-2012-configuration-manager-console-extensions/

 

 

SCCM client install failed with exit code 1603

Sometime when you try to install SCCM Client in your Environment a few clients fails and this procedure can be solve at least one of the reasons.YOu can find this error in the logs:
  • -cient.msi installation failed. Error text: ExitCode: 1603.
  • MSI: Warnung 25702. Failed to uninstall PrepDrvr.Sys for Software Metering Agent.- client.msi installation failed. Error text: ExitCode: 1603.
  • MSI: Warning 25702. Failed to uninstall PrepDrvr.Sys for Software Metering Agent.
 If the other solutions dont Works, you can try this:

Stop the Services:
1. Stopp SMS Agent Host Service
2. Stopp CCMSetup service (if present)

Delete Files and Folders:
3. Delete \windows\ccm directory
4. Delete \windows\ccmsetup directory
5. Delete \windows\ccmcache directory
6. Delete \windows\smscfg.ini
7. Delete \windows\sms*.mif (if present)

Delete Registry Entries:
8. Delete HKLM\software\Microsoft\ccm registry keys
9. Delete HKLM\software\Microsoft\CCMSETUP registry keys
10. Delete HKLM\software\Microsoft\SMS registry keys

Delete WMI Namespace:
11. Delete root\cimv2\sms WMI namespace
12. Delete root\ccm WMI namespace

Delete Folder at the Task Scheduler:
13. In Task Scheduler library, under “Microsoft” delete the “Configuration Manager” folder and any tasks within it

For this you can use the following PS-Script instead:
Try { Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force -ErrorAction Stop } Catch {}

# Stop Services
Stop-Service -Name ccmsetup -Force -ErrorAction SilentlyContinue
Stop-Service -Name CcmExec -Force -ErrorAction SilentlyContinue
Stop-Service -Name smstsmgr -Force -ErrorAction SilentlyContinue
Stop-Service -Name CmRcService -Force -ErrorAction SilentlyContinue

# Remove WMI Namespaces
Get-WmiObject -Query “SELECT * FROM __Namespace WHERE Name=’ccm'” -Namespace root | Remove-WmiObject
Get-WmiObject -Query “SELECT * FROM __Namespace WHERE Name=’sms'” -Namespace root\cimv2 | Remove-WmiObject

# Remove Services from Registry
$MyPath = “HKLM:\SYSTEM\CurrentControlSet\Services”
Remove-Item -Path $MyPath\CCMSetup -Force -Recurse -ErrorAction SilentlyContinue
Remove-Item -Path $MyPath\CcmExec -Force -Recurse -ErrorAction SilentlyContinue
Remove-Item -Path $MyPath\smstsmgr -Force -Recurse -ErrorAction SilentlyContinue
Remove-Item -Path $MyPath\CmRcService -Force -Recurse -ErrorAction SilentlyContinue

# Remove SCCM Client from Registry
$MyPath = “HKLM:\SOFTWARE\Microsoft”
Remove-Item -Path $MyPath\CCM -Force -Recurse -ErrorAction SilentlyContinue
Remove-Item -Path $MyPath\CCMSetup -Force -Recurse -ErrorAction SilentlyContinue
Remove-Item -Path $MyPath\SMS -Force -Recurse -ErrorAction SilentlyContinue

# Remove Folders and Files
$MyPath = $env:WinDir
Remove-Item -Path $MyPath\CCM -Force -Recurse -ErrorAction SilentlyContinue
Remove-Item -Path $MyPath\ccmsetup -Force -Recurse -ErrorAction SilentlyContinue
Remove-Item -Path $MyPath\ccmcache -Force -Recurse -ErrorAction SilentlyContinue
Remove-Item -Path $MyPath\SMSCFG.ini -Force -ErrorAction SilentlyContinue
Remove-Item -Path $MyPath\SMS*.mif -Force -ErrorAction SilentlyContinue

And the final Steps are the following:
1. First run at an elevated Prompt : CHKDSK /F
2. Reboot
3. Open an elevated CMD and run the following command:
fsutil resource setautoreset true C:\
4. Reboot
5. Install the SCCM Agent

 

You can find the entire  blog discussion here:

https://prajwaldesai.com/community/threads/sccm-client-install-failed-with-exit-code-1603.1047/

Guide to solve Issues\Problems in SCCM

Microsoft published some guides about solving issues related with all functionalities of SCCM:

Content Distribution Process: Understanding and Troubleshooting Content Distribution in Microsoft Configuration Manager:

Software Updates Process: Software Updates in Configuration Manager Current Branch Deep Dive – Client Operations

Software Update Process Problems: Software Update Management Troubleshooting in Configuration Manager:

Software Update Sychronization: Configuring Software Update synchronization in System Center Configuration Manager:

WSUS Complete Maintenance: complete guide to Microsoft WSUS and Configuration Manager SUP maintenance

DRS Problems: Troubleshooting the Database Replication Service in Microsoft Configuration Manager:

Install Application Task Sequence: Troubleshoot the Install Application task sequence in Microsoft Configuration Manager.

PXE Boot Issues: Troubleshooting PXE boot issues in Configuration Manager 2012

FlowChart Update replication : Flowchart – Update replication for System Center Configuration Manager

Software Update Troubleshooting: Software Update Management Troubleshooting in Configuration Manager:

TechNet search: System Center: Configuration Manager Troubleshooting

 

 

 

 

In-Place Upgrade Windows 10

Environment: SCCM 2012 R2 1511, Windows 10 ISO file, Windows 7 to be migrated.

Add the Windows 10 iso file as a Operating System Upgrade Package.

Select the files where your Windows 10 is placed.

Distribute the content to the Distributions Points

Create a Task Sequence and select the ” Upgrade an Operating System from upgrade package”

Browse the Operating System upgrade package

Do not install any software updates.

Finish the Task Sequence.

Create a Device Collection and place there the target macchine.

Create a Deploy of the Task Sequence, and select the Collection created in the step before.

Just wait for the deployment and review smsts.log to avoid any errors.

All these steps are extracted from the following sites:

https://technet.microsoft.com/en-us/itpro/windows/deploy/upgrade-to-windows-10-with-system-center-configuraton-manager

In-place upgrade to Windows 10 Enterprise with SCCM

SCCM Hardware Inventory Report

This query get all information related with our hardware and could be used to generate custom report:

DECLARE @Today AS DATE
SET @Today  =  GETDATE()
DECLARE @BackInTime AS DATE
SET @BackInTime = DATEADD(DAY, -30, @Today )
SELECT DISTINCT
SYS.ResourceID,
SYS.Name0 ‘Name’,
SYS.Full_Domain_Name0,
SYS.AD_Site_Name0  ‘ADSite’,
CS.UserName0 ‘User Name’,
CASE
WHEN U.TopConsoleUser0 = ‘-1’ OR U.TopConsoleUser0 IS NULL THEN ‘N/A’
ELSE U.TopConsoleUser0
END AS TopUser,
REPLACE((REPLACE((REPLACE((REPLACE((REPLACE((REPLACE (OS.Caption0, ‘Microsoft Windows’,’Win’)),’Enterprise’,’EE’) ),’Standard’,’ST’)),’Microsoft®’,”)),’Server’,’SRV’)),’Windows’,’Win’) OS,
REPLACE (OS.CSDVersion0,’Service Pack’,’SP’) ‘Service Pack’,
CASE  OS.ProductType0
WHEN ‘1’ THEN ‘WorkStation’
WHEN ‘2’ THEN ‘Server’
WHEN ‘3’ THEN ‘Server’
ELSE ‘Undefinded’
END as ProductType,
CS.Manufacturer0 ‘Manufacturer’,
CS.Model0 Model,
BIOS.SerialNumber0 ‘Serial Number’,
CONVERT (DATE,BIOS.ReleaseDate0) AS BIOSDate,
BIOS.SMBIOSBIOSVersion0 AS BIOSVersion,
(SELECT CONVERT(DATE,SYS.Creation_Date0)) ‘Managed Date’,
RAM.Capacity0 ‘Memory (MB)’,
COUNT(RAM.ResourceID) ‘# Memory Slots’,
REPLACE (cs.SystemType0,’-based PC’,”) ‘Type’,
SUM(D.Size0) / 1024 AS ‘Disk Size GB’,
CONVERT(VARCHAR(26), OS.LastBootUpTime0, 100) AS ‘Last Reboot Date/Time’,
CONVERT(VARCHAR(26), OS.InstallDate0, 101) AS ‘Install Date’,
CONVERT(VARCHAR(26), WS.LastHWScan, 101) AS ‘Last Hardware Inventory’,
CONVERT(VARCHAR(26), CH.LastOnline, 101) AS ‘Last Seen Online’,
SYS.Client_Version0 as ‘SCCM Agent Version’,
CPU.Manufacturer AS ‘CPU Man.’,
CPU.[Number of CPUs] AS ‘# of CPUs’,
CPU.[Number of Cores per CPU] AS ‘# of Cores per CPU’,
CPU.[Logical CPU Count] AS ‘Logical CPU Count’,
US.ScanTime AS ‘ Windows Updates Scan Time’ ,
US.LastErrorCode AS ‘ Windows Updates Last Error Code’ ,
US.LastScanPackageLocation AS ‘ Windows Updates Last Package Location’ ,
CASE SE.ChassisTypes0
WHEN ‘1’ THEN ‘Other’
WHEN ‘2’ THEN ‘Unknown’
WHEN ‘3’ THEN ‘Desktop’
WHEN ‘4’ THEN ‘Low Profile Desktop’
WHEN ‘5’ THEN ‘Pizza Box’
WHEN ‘6’ THEN ‘Mini Tower’
WHEN ‘7’ THEN ‘Tower’
WHEN ‘8’ THEN ‘Portable’
WHEN ‘9’ THEN ‘Laptop’
WHEN ’10’ THEN ‘Notebook’
WHEN ’11’ THEN ‘Hand Held’
WHEN ’12’ THEN ‘Docking Station’
WHEN ’13’ THEN ‘All in One’
WHEN ’14’ THEN ‘Sub Notebook’
WHEN ’15’ THEN ‘Space-Saving’
WHEN ’16’ THEN ‘Lunch Box’
WHEN ’17’ THEN ‘Main System Chassis’
WHEN ’18’ THEN ‘Expansion Chassis’
WHEN ’19’ THEN ‘SubChassis’
WHEN ’20’ THEN ‘Bus Expansion Chassis’
WHEN ’21’ THEN ‘Peripheral Chassis’
WHEN ’22’ THEN ‘Storage Chassis’
WHEN ’23’ THEN ‘Rack Mount Chassis’
WHEN ’24’ THEN ‘Sealed-Case PC’
ELSE ‘Undefinded’
END AS ‘PC Type’
FROM
v_R_System SYS
INNER JOIN (
SELECT
Name0,
MAX(Creation_Date0) AS Creation_Date
FROM
dbo.v_R_System
GROUP BY
Name0
) AS CleanSystem
ON SYS.Name0 = CleanSystem.Name0 AND SYS.Creation_Date0 = CleanSystem.Creation_Date
LEFT JOIN v_GS_COMPUTER_SYSTEM CS
ON SYS.ResourceID=cs.ResourceID
LEFT JOIN v_GS_PC_BIOS BIOS
ON SYS.ResourceID=bios.ResourceID
LEFT JOIN (
SELECT
A.ResourceID,
MAX(A.[InstallDate0]) AS [InstallDate0]
FROM
v_GS_OPERATING_SYSTEM A
GROUP BY
A.ResourceID
) AS X
ON SYS.ResourceID = X.ResourceID
INNER JOIN v_GS_OPERATING_SYSTEM OS
ON X.ResourceID=OS.ResourceID AND X.InstallDate0 = OS.InstallDate0
–LEFT JOIN v_GS_PHYSICAL_MEMORY RAM
LEFT JOIN (
Select Distinct
(RAM.ResourceID) as [ResourceID],
SUM(RAM.Capacity0) as [Capacity0]
FROM v_GS_PHYSICAL_MEMORY RAM
Group By
RAM.ResourceID
) RAM
ON SYS.ResourceID=ram.ResourceID
LEFT OUTER JOIN dbo.v_GS_LOGICAL_DISK D
ON SYS.ResourceID = D.ResourceID AND D.DriveType0 = 3
LEFT OUTER JOIN v_GS_SYSTEM_CONSOLE_USAGE_MAXGROUP U
ON SYS.ResourceID = U.ResourceID
LEFT JOIN dbo.v_GS_SYSTEM_ENCLOSURE SE ON SYS.ResourceID = SE.ResourceID
LEFT JOIN dbo.v_GS_ENCRYPTABLE_VOLUME En  ON SYS.ResourceID = En.ResourceID
LEFT JOIN dbo.v_GS_WORKSTATION_STATUS WS ON SYS.ResourceID = WS.ResourceID
LEFT JOIN v_CH_ClientSummary CH
ON SYS.ResourceID = CH.ResourceID
LEFT JOIN (
SELECT
DISTINCT(CPU.SystemName0) AS [System Name],
CPU.Manufacturer0 AS Manufacturer,
CPU.ResourceID,
CPU.Name0 AS Name,
COUNT(CPU.ResourceID) AS [Number of CPUs],
CPU.NumberOfCores0 AS [Number of Cores per CPU],
CPU.NumberOfLogicalProcessors0 AS [Logical CPU Count]
FROM [dbo].[v_GS_PROCESSOR] CPU
GROUP BY
CPU.SystemName0,
CPU.Manufacturer0,
CPU.Name0,
CPU.NumberOfCores0,
CPU.NumberOfLogicalProcessors0,
CPU.ResourceID
) CPU
ON CPU.ResourceID = SYS.ResourceID
LEFT JOIN  v_UpdateScanStatus US
ON US.ResourceID =  SYS.ResourceID
WHERE SYS.obsolete0=0 AND SYS.client0=1 AND SYS.obsolete0=0 AND SYS.active0=1 AND
CH.LastOnline BETWEEN @BackInTime AND GETDATE()
GROUP BY
SYS.Creation_Date0 ,
SYS.Name0 ,
SYS.Full_Domain_Name0,
SYS.ResourceID ,
SYS.AD_Site_Name0 ,
CS.UserName0 ,
REPLACE((REPLACE((REPLACE((REPLACE((REPLACE((REPLACE (OS.Caption0, ‘Microsoft Windows’,’Win’)),’Enterprise’,’EE’) ),’Standard’,’ST’)),’Microsoft®’,”)),’Server’,’SRV’)),’Windows’,’Win’),
REPLACE (OS.CSDVersion0,’Service Pack’,’SP’),
CS.Manufacturer0 ,
CS.Model0 ,
BIOS.SerialNumber0 ,
REPLACE (cs.SystemType0,’-based PC’,”) ,
OS.ProductType0,
CONVERT(VARCHAR(26), OS.LastBootUpTime0, 100) ,
CONVERT(VARCHAR(26), OS.InstallDate0, 101) ,
CONVERT(VARCHAR(26), WS.LastHWScan, 101),
CASE
WHEN U.TopConsoleUser0 = ‘-1’ OR U.TopConsoleUser0 IS NULL THEN ‘N/A’
ELSE U.TopConsoleUser0
END,
RAM.Capacity0 ,
CPU.Manufacturer,
CPU.[Number of CPUs] ,
CPU.[Number of Cores per CPU],
CPU.[Logical CPU Count],
US.ScanTime  ,
US.LastErrorCode ,
US.LastScanPackageLocation ,
CASE SE.ChassisTypes0
WHEN ‘1’ THEN ‘Other’
WHEN ‘2’ THEN ‘Unknown’
WHEN ‘3’ THEN ‘Desktop’
WHEN ‘4’ THEN ‘Low Profile Desktop’
WHEN ‘5’ THEN ‘Pizza Box’
WHEN ‘6’ THEN ‘Mini Tower’
WHEN ‘7’ THEN ‘Tower’
WHEN ‘8’ THEN ‘Portable’
WHEN ‘9’ THEN ‘Laptop’
WHEN ’10’ THEN ‘Notebook’
WHEN ’11’ THEN ‘Hand Held’
WHEN ’12’ THEN ‘Docking Station’
WHEN ’13’ THEN ‘All in One’
WHEN ’14’ THEN ‘Sub Notebook’
WHEN ’15’ THEN ‘Space-Saving’
WHEN ’16’ THEN ‘Lunch Box’
WHEN ’17’ THEN ‘Main System Chassis’
WHEN ’18’ THEN ‘Expansion Chassis’
WHEN ’19’ THEN ‘SubChassis’
WHEN ’20’ THEN ‘Bus Expansion Chassis’
WHEN ’21’ THEN ‘Peripheral Chassis’
WHEN ’22’ THEN ‘Storage Chassis’
WHEN ’23’ THEN ‘Rack Mount Chassis’
WHEN ’24’ THEN ‘Sealed-Case PC’
ELSE  ‘Undefinded’
END ,
CONVERT (DATE,BIOS.ReleaseDate0) ,
BIOS.SMBIOSBIOSVersion0 ,
SYS.Client_Version0 ,
CONVERT(VARCHAR(26) ,CH.LastOnline, 101)
ORDER BY SYS.Name0

Some of the fields have been modified to comply my needs.
Original Source:

https://ammarhasayen.com/2015/03/01/config-manager-2012-sccm-most-amazing-hardware-inventory-sql-report/

Logs SCCM Task sequence Where?

Every time that i have to deploy something using task sequences, i ask mysef where SCCM save the logs? . Depending on where the task sequence is failing, you should find the smsts.log file in one of the following locations.

  • Windows PE before HDD format: x:\windows\temp\smstslog\smsts.log
  • Windows PE after HDD format: x:\smstslog\smsts.log and copied to c:\_SMSTaskSequence\Logs\Smstslog\smsts.log
  • Full version Windows before SCCM agent installed: c:\_SMSTaskSequence\Logs\Smstslog\smsts.log
  • Full version Windows after SCCM agent installed: c:\windows\ccm\logs\Smstslog\smsts.log
  • Full version Windows (x64) after SCCM agent installed: c:\windows\sysWOW64\ccm\logs\Smstslog\smsts.log
  • After Task Sequence has finished running: c:\windows\ccm\logs\smsts.log
  • After Task Sequence has finished running (x64): c:\windows\sysWOW64\ccm\logs\smsts.log