Friday, November 10, 2023

SCCM Application Deployment Tool

SCCM Application Deployment Tool

Streamlining SCCM Application Deployments: Introducing the SCCM Application Deployment Tool.

In the realm of System Center Configuration Manager (SCCM), application deployments play a pivotal role in ensuring that software reaches client machines seamlessly. However, the challenge lies in maintaining deployment consistency and catching potential issues before they impact end-users. To address this, we've developed the SCCM Application Deployment Tool — a straightforward solution designed to enhance the deployment process and provide valuable insights into its success.

## Key Features:

 ### Deployment Validation with a Twist

 One standout feature of our tool is the 30-minute deployment delay. This intentional pause allows deployment teams to catch potential issues before they hit client machines hard. Think of it as a safety net, giving you the opportunity to review and validate deployments, ensuring a smoother user experience.

### Email Notifications for Effective Communication

 Communication is key, especially in the fast-paced world of IT deployments. Our tool sends email notifications to specified distribution lists and selected approvers, keeping everyone in the loop. This not only enhances collaboration but also establishes accountability throughout the deployment process.


### Hardcoded Simplicity

 Recognizing the need for simplicity and to prevent accidental deletions, all configurations are hardcoded directly within the script. While we acknowledge that this may not be the most flexible approach, it aims to streamline the deployment process for application teams. Customization can still be achieved by modifying the script itself.

 

This is how the tool looks




This is the email that is received for each deployment.




**Download the SCCM Application Deployment Tool and start streamlining your deployments today!**

 

[Link to download the tool]

 

We're excited to hear your thoughts. Feel free to reach out with feedback, suggestions, or even to share how the SCCM Application Deployment Tool has improved your deployment processes.

Tuesday, December 6, 2022

SCCM SQL query for Application deployment status with Error code

 select distinct

s1.netbios_name0 as 'Computer Name',

GS.Caption0 as 'OS',

s1.User_Name0 as 'User Name',

aa.ApplicationName,

aa.CollectionName as 'Target Collection',

case

when ae.AppEnforcementState = 1000 then 'Success'

when ae.AppEnforcementState = 1001 then 'Already Compliant'

when ae.AppEnforcementState = 1002 then 'Simulate Success'

when ae.AppEnforcementState = 2000 then 'In Progress'

when ae.AppEnforcementState = 2001 then 'Waiting for Content'

when ae.AppEnforcementState = 2002 then 'Installing'

when ae.AppEnforcementState = 2003 then 'Restart to Continue'

when ae.AppEnforcementState = 2004 then 'Waiting for maintenance window'

when ae.AppEnforcementState = 2005 then 'Waiting for schedule'

when ae.AppEnforcementState = 2006 then 'Downloading dependent content'

when ae.AppEnforcementState = 2007 then 'Installing dependent content'

when ae.AppEnforcementState = 2008 then 'Restart to complete'

when ae.AppEnforcementState = 2009 then 'Content downloaded'

when ae.AppEnforcementState = 2010 then 'Waiting for update'

when ae.AppEnforcementState = 2011 then 'Waiting for user session reconnect'

when ae.AppEnforcementState = 2012 then 'Waiting for user logoff'

when ae.AppEnforcementState = 2013 then 'Waiting for user logon'

when ae.AppEnforcementState = 2014 then 'Waiting to install'

when ae.AppEnforcementState = 2015 then 'Waiting retry'

when ae.AppEnforcementState = 2016 then 'Waiting for presentation mode'

when ae.AppEnforcementState = 2017 then 'Waiting for Orchestration'

when ae.AppEnforcementState = 2018 then 'Waiting for network'

when ae.AppEnforcementState = 2019 then 'Pending App-V Virtual Environment'

when ae.AppEnforcementState = 2020 then 'Updating App-V Virtual Environment'

when ae.AppEnforcementState = 3000 then 'Requirements not met'

when ae.AppEnforcementState = 3001 then 'Host platform not applicable'

when ae.AppEnforcementState = 4000 then 'Unknown'

when ae.AppEnforcementState = 5000 then 'Deployment failed'

when ae.AppEnforcementState = 5001 then 'Evaluation failed'

when ae.AppEnforcementState = 5002 then 'Deployment failed'

when ae.AppEnforcementState = 5003 then 'Failed to locate content'

when ae.AppEnforcementState = 5004 then 'Dependency installation failed'

when ae.AppEnforcementState = 5005 then 'Failed to download dependent content'

when ae.AppEnforcementState = 5006 then 'Conflicts with another application deployment'

when ae.AppEnforcementState = 5007 then 'Waiting retry'

when ae.AppEnforcementState = 5008 then 'Failed to uninstall superseded deployment type'

when ae.AppEnforcementState = 5009 then 'Failed to download superseded deployment type'

when ae.AppEnforcementState = 5010 then 'Failed to updating App-V Virtual Environment'

End as 'Status',

apr.ErrorCode

from v_R_System s1

left join vAppDTDeploymentResultsPerClient ae on ae.ResourceID = s1.ResourceID

left join v_ApplicationAssignment aa on ae.AssignmentID = aa.AssignmentID

left join v_GS_OPERATING_SYSTEM GS on GS.ResourceID=S1.ResourceID

left join vAppDeploymentErrorAssetDetails apr on s1.ResourceID=apr.MachineID and aa.AssignmentID=apr.AssignmentID

where aa.AssignmentID = '16790885'

order by s1.Netbios_Name0

Monday, November 28, 2022

SCCM SQL Query to get list of applications from a specific folder in the console.

 select 

app.DisplayName,

app.Description,

fol.objectpath,

app.CreatedBy,

app.LastModifiedBy,

app.DateCreated,

app.DateLastModified,

assgn.CollectionName [Deployed Collection]

from fn_ListLatestApplicationCIs(1033) app

left join v_ConfigurationItems conf on app.CI_UniqueID = conf.cI_uniqueID 

full join v_ApplicationAssignment assgn on conf.CI_UniqueID=assgn.AssignedCI_UniqueID

JOIN vFolderMembers fol ON fol.InstanceKey = conf.modelName

JOIN vSMS_Folders sms on fol.ContainerNodeID = sms.ContainerNodeID

where fol.objectpath like '/PROD/Application  Deployment/Test' or fol.objectpath like '/DEV/Test' or fol.objectpath like '/CAS/Application Deployment/Test'

order by fol.objectpath


Replace the folder name where its highlighted.

Thursday, November 24, 2022

SCCM SQL query for OS build numbers

If we try to get OS and Build number information from V_GS_OperatingSystem, it may not uptodate if Hardware inventory is not updated.

If we need OS and build number information, even if the Client is not updated with recent Hardware inventory then we can use V_R_Sytem.


select sys.Name0 as 'Hostname',

sys.User_Name0 as 'Username',

case 

when sys.Operating_System_Name_and0 like '%server%' then 'Server' 

when sys.Operating_System_Name_and0 like '%workstation 6%' then 'Windows 7'

when sys.Operating_System_Name_and0 like '%workstation 5%' then 'Windows XP'

when sys.Operating_System_Name_and0 like '%workstation 10%' and sys.Build01 like '%19045%'  then 'Windows 10 Build 22H2'

when sys.Operating_System_Name_and0 like '%workstation 10%' and sys.Build01 like '%22621%'  then 'Windows 11 Build 22H2'

when sys.Operating_System_Name_and0 like '%workstation 10%' and sys.Build01 like '%17134%'  then 'Windows 10 Build 1803'

when sys.Operating_System_Name_and0 like '%workstation 10%' and sys.Build01 like '%22000%'  then 'Windows 11 Build 21H2'

when sys.Operating_System_Name_and0 like '%workstation 10%' and sys.Build01 like '%19044%'  then 'Windows 10 Build 21H2'

when sys.Operating_System_Name_and0 like '%workstation 10%' and sys.Build01 like '%19043%'  then 'Windows 10 Build 21H1'

when sys.Operating_System_Name_and0 like '%workstation 10%' and sys.Build01 like '%19042%'  then 'Windows 10 Build 20H2'

when sys.Operating_System_Name_and0 like '%workstation 10%' and sys.Build01 like '%19041%'  then 'Windows 10 Build 2004'

when sys.Operating_System_Name_and0 like '%workstation 10%' and sys.Build01 like '%18363%'  then 'Windows 10 Build 1909'

when sys.Operating_System_Name_and0 like '%workstation 10%' and sys.Build01 like '%18362%'  then 'Windows 10 Build 1903'

when sys.Operating_System_Name_and0 like '%workstation 10%' and sys.Build01 like '%17763%'  then 'Windows 10 Build 1809'

when sys.Operating_System_Name_and0 like '%workstation 10%' and sys.Build01 like '%16299%'  then 'Windows 10 Build 1709'

when sys.Operating_System_Name_and0 like '%workstation 10%' and sys.Build01 like '%15063%'  then 'Windows 10 Build 1703'

when sys.Operating_System_Name_and0 like '%workstation 10%' and sys.Build01 like '%14393%'  then 'Windows 10 Build 1607'

when sys.Operating_System_Name_and0 like '%workstation 10%' and sys.Build01 like '%10240%'  then 'Windows 10 Build 1507'

when sys.Operating_System_Name_and0 like '%workstation 10%' and sys.Build01 like '%10586%'  then 'Windows 10 Build 1511'

when sys.Operating_System_Name_and0 like '%workstation 10%' and sys.Build01 is NULL then 'Windows 10 Build not specified'

else sys.Operating_System_Name_and0

end as 'O/S',

cs.Manufacturer0 [Make],

cs.Model0 [Model],

bios.SMBIOSBIOSVersion0

from V_R_system sys

left join v_gs_operating_system os on sys.ResourceID=os.ResourceID

left join v_FullCollectionMembership col on sys.ResourceID = col.ResourceID

LEFT JOIN v_GS_COMPUTER_SYSTEM cs on sys.ResourceID=cs.ResourceID

left JOIN v_GS_PC_BIOS BIOS ON sys.ResourceID=BIOS.ResourceID

where col.CollectionID = 'DEV01F7F'

Wednesday, October 26, 2022

WQL query to create SCCM collection based on patch deployment status

select 

SMS_R_SYSTEM.ResourceID,

SMS_R_SYSTEM.ResourceType,

SMS_R_SYSTEM.Name,

SMS_R_SYSTEM.SMSUniqueIdentifier,

SMS_R_SYSTEM.ResourceDomainORWorkgroup,

SMS_R_SYSTEM.Client

from SMS_R_System

inner join   SMS_SUMDeploymentAssetDetails on   SMS_SUMDeploymentAssetDetails.ResourceID = SMS_R_System.ResourceId 

where SMS_SUMDeploymentAssetDetails.AssignmentID = "10700151"   and SMS_SUMDeploymentAssetDetails.StatusType = "1"


Status type.

Value Status type

1         Success

2         InProgress

4         Unknown

5         Error



With Specific Deployment status 


select 

SYS.ResourceID,

SYS.ResourceType,

SYS.Name,

SYS.SMSUniqueIdentifier,

SYS.ResourceDomainORWorkgroup,

SYS.Client

from sms_r_system as sys inner join SMS_SUMDeploymentAssetDetails as offer on sys.ResourceID=offer.ResourceID 

WHERE offer.AssignmentID IN ('16794400') AND offer.StatusDescription = 'Pending system restart'





If you like to test it via Powershell to find out the column name to filter, try like below.

#Patches 

$SCCMPrimaryServername = 'server-105'

$SiteCode = 'AOL'

Get-WmiObject -ComputerName $SCCMPrimaryServername -Namespace root\sms\site_$SiteCode -Class SMS_SUMDeploymentAssetDetails  -Filter 'AssignmentID = "19700191"' | select DeviceName


WQL query to create SCCM collection based on Package deployment status

select 

SMS_R_SYSTEM.ResourceID,

SMS_R_SYSTEM.ResourceType,

SMS_R_SYSTEM.Name,

SMS_R_SYSTEM.SMSUniqueIdentifier,

SMS_R_SYSTEM.ResourceDomainORWorkgroup,

SMS_R_SYSTEM.Client

 from SMS_R_System

 inner join SMS_ClassicDeploymentAssetDetails on SMS_ClassicDeploymentAssetDetails.DeviceID = SMS_R_System.ResourceId 

where SMS_ClassicDeploymentAssetDetails.DeploymentID = 'ABC20140' and SMS_ClassicDeploymentAssetDetails.StatusType = '1'




Status type.


Value Status type

1 Success

2 InProgress

4 Unknown

5 Error



If you like to test it via powershell,

#Package 

$SCCMPrimaryServername = 'Server-25'

$SiteCode = 'AOL'


Get-WmiObject -ComputerName $SCCMPrimaryServername -Namespace root\sms\site_$SiteCode -Class SMS_ClassicDeploymentAssetDetails  -Filter 'DeploymentID = "AOL20140"' | select Devicename,StatusDescription


WQL query to create SCCM collection based on Application deployment status

 select 

SMS_R_SYSTEM.ResourceID,

SMS_R_SYSTEM.ResourceType,

SMS_R_SYSTEM.Name,

SMS_R_SYSTEM.SMSUniqueIdentifier,

SMS_R_SYSTEM.ResourceDomainORWorkgroup,

SMS_R_SYSTEM.Client

 from SMS_R_System

  inner join   SMS_AppDeploymentAssetDetails   on   SMS_AppDeploymentAssetDetails.MachineID = SMS_R_System.ResourceId 

where SMS_AppDeploymentAssetDetails.AssignmentID = "100000003"   and SMS_AppDeploymentAssetDetails.StatusType = "1"




Application status type. Possible values are:


Value Application status

1 Success

2 InProgress

3 RequirementsNotMet

4 Unknown

5 Error


If you like to test it via Powershell,

#Application 

$SCCMPrimaryServername = 'Server-25'

$SiteCode = 'AOL'


Get-WmiObject -ComputerName $SCCMPrimaryServername -Namespace root\sms\site_$SiteCode -Class SMS_AppDeploymentAssetDetails -Filter 'AssignmentID = "29725319"' | select MachineName 


Friday, September 23, 2022

SCCM SCAN error Same as HTTP status 401 - the requested resource requires user authentication.

Same as HTTP status 401 - the requested resource requires user authentication.

reset proxy to fix the issue.

netsh winhttp reset proxy

SCCM Client Installation error 1638 for VC_redist.x64.exe

SCCM Client Installation error 1638 for VC_redist.x64.exe

1638 meaning:

Another version of this product is already installed. Installation of this version cannot continue. To configure or remove the existing version of this product, use Add/Remove Programs on the Control Panel.

Uninstall the latest version from the machine and install the pre req as per MS.

Pre-req as per MS is old version than some of the machines in our network. 


"C:\ProgramData\Package Cache\{7f336035-fa39-4d06-bd17-fbf472a381e8}\VC_redist.x64.exe" /uninstall /quiet /norestart 


"C:\ProgramData\Package Cache\{9120a466-433b-4dd9-a5e0-3092abd2cc1d}\VC_redist.x86.exe" /uninstall /quiet /norestart 


"C:\ProgramData\Package Cache\{43d1ce82-6f55-4860-a938-20e5deb28b98}\VC_redist.x64.exe" /uninstall /quiet /norestart 


"C:\ProgramData\Package Cache\{fa7f6d52-f85e-48ef-8f56-a37268aa5772}\VC_redist.x64.exe" /uninstall /quiet /norestart 


"C:\ProgramData\Package Cache\{4b2f3795-f407-415e-88d5-8c8ab322909d}\VC_redist.x64.exe" /uninstall /quiet /norestart 

How to disable Metered network

Here is Network Card connection metered information:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DusmSvc\Profiles\{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}\* in REG_DWORD name UserCost indicate if metered or not
with {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} your Network Card GUID
and
UserCost = 0 when Metered is off
UserCost = 2 when Metered is on

You need to restart "Data Usage" Service DusmSvc before your settings take effect

Friday, August 26, 2022

Task sequence detailed failed steps with deployment ID

 select 

VRS.Name0,

vTS.Step,

vTS.GroupName,

vTS.ActionName,

vTS.ExecutionTime,

vTS.LastStatusMessageIDName,

vTS.ExitCode,

Vts.ActionOutput

from v_TaskExecutionStatus vTS

LEFT JOIN v_R_System VRS ON Vts.ResourceID = VRS.ResourceID

where vTS.AdvertisementID = 'ABC123456' --deployment ID

--and vrs.Name0 = 'machine1'

AND vTS.ExitCode !='0' and  vTS.ExitCode !='3010'

and vTS.LastStatusMessageIDName  Like '%Failed%'

order by vts.ExecutionTime


SCCM Application Deployment Tool

SCCM Application Deployment Tool Streamlining SCCM Application Deployments: Introducing the SCCM Application Deployment Tool. In the realm o...