Saturday, July 27, 2024

MECM Deployment Kit

Streamlining Deployments with a GUI Tool Built on PowerShell

In our ongoing efforts to enhance efficiency and streamline our deployment processes, we have Upgraded our previously built PowerShell GUI Tool. This tool simplifies the deployment process and ensures that all necessary conditions and notifications are met. Once a deployment is created, the tool automatically sends an email to our distribution list (DL), keeping all relevant parties informed.

 Deployable Objects

The tool supports the deployment of the following objects:
    - Applications
    - Packages
    - Task Sequences (Non-Imaging)

Deployment Targets

Deployments can be made to:
    - User Collections
    - Device Collections

Key Conditions

To maintain a smooth and error-free deployment process, the following conditions must be adhered to:

1. Exclusion of Default Collections
   - Collections starting with "SMS" are default collections and cannot be used for deployments.

2. Validation for Required Deployments
   - Required deployments will not allow you to use collections with any members. After the validation is complete, devices can be added to the collection.

3. Time Restrictions
   - For both available and required deployments, you cannot use a time that is earlier than the current time.

4. Notification Settings
   - Notification settings are integrated for package and task sequence deployments to ensure all necessary parties are informed promptly.


How It Works

1. Select the Object to Deploy
   - Choose from applications, packages, or task sequences.

2. Choose the Target Collection
   - Select either a user collection or a device collection for the deployment. (Enable checkbox for user collection)

3. Adhere to Conditions
   - Ensure that no default collections are used, and validate collections for required deployments.
   - Set the deployment time to ensure it is not earlier than the current time.

4. Deployment Notification
   - Upon creating a deployment, the tool will send an email notification to the designated distribution list, providing details of the deployment.


Benefits


- Ease of Use
  - The GUI tool provides a user-friendly interface that simplifies the deployment process.
  
- Automated Notifications
  - Automatic email notifications keep everyone informed about the status and details of deployments.

- Compliance with Conditions
  - The tool enforces conditions to prevent common deployment errors, ensuring smoother operations.

- Versatility
  - Supports a wide range of deployment objects and targets, catering to various needs.

By integrating this GUI tool into our deployment workflow, we have significantly improved efficiency and reduced the likelihood of errors. This tool exemplifies our commitment to leveraging technology to streamline processes and enhance operational effectiveness.

Feel free to reach out with any questions or feedback about using the GUI tool for deployments.


Screenshot of GUI Tool

Application Deployment 
                                    

Email Sample after deployment creation -Application


===============================================
Package Deployment


Email Sample after deployment creation -Package 


=========================================================
Task Sequence Deployment (Non Imaging TS only)


Email Sample after deployment creation - Task Sequence



------------------------------------------------------------------------------------

Script is available to download from GitHub





Tuesday, July 2, 2024

MECM SQL query to get application deployment type and its details

 

;WITH XMLNAMESPACES ( DEFAULT 'http://schemas.microsoft.com/SystemsCenterConfigurationManager/2009/06/14/Rules', 'http://schemas.microsoft.com/SystemCenterConfigurationManager/2009/AppMgmtDigest' as p1)

SELECT

A.[App Name],max(A.[DT Name])[DT Title],A.Type

,A.ContentLocation ,A.InstallCommandLine,A.UninstallCommandLine,A.ExecutionContext,A.RequiresLogOn

,A.UserInteractionMode,A.OnFastNetwork,A.OnSlowNetwork,A.DetectAction

from (

SELECT LPC.DisplayName [App Name]

,(LDT.SDMPackageDigest.value('(/p1:AppMgmtDigest/p1:DeploymentType/p1:Title)[1]', 'nvarchar(max)')) AS [DT Name]

,LDT.SDMPackageDigest.value('(/p1:AppMgmtDigest/p1:DeploymentType/p1:Installer/@Technology)[1]', 'nvarchar(max)') AS [Type]

,LDT.SDMPackageDigest.value('(/p1:AppMgmtDigest/p1:DeploymentType/p1:Installer/p1:Contents/p1:Content/p1:Location)[1]', 'nvarchar(max)') AS [ContentLocation]

,LDT.SDMPackageDigest.value('(/p1:AppMgmtDigest/p1:DeploymentType/p1:Installer/p1:InstallAction/p1:Args/p1:Arg)[1]', 'nvarchar(max)') AS [InstallCommandLine]

,LDT.SDMPackageDigest.value('(/p1:AppMgmtDigest/p1:DeploymentType/p1:Installer/p1:UninstallAction/p1:Args/p1:Arg)[1]', 'nvarchar(max)') AS [UninstallCommandLine]

,LDT.SDMPackageDigest.value('(/p1:AppMgmtDigest/p1:DeploymentType/p1:Installer/p1:InstallAction/p1:Args/p1:Arg)[3]', 'nvarchar(max)') AS [ExecutionContext]

,LDT.SDMPackageDigest.value('(/p1:AppMgmtDigest/p1:DeploymentType/p1:Installer/p1:InstallAction/p1:Args/p1:Arg)[4]', 'nvarchar(max)') AS [RequiresLogOn]

,LDT.SDMPackageDigest.value('(/p1:AppMgmtDigest/p1:DeploymentType/p1:Installer/p1:InstallAction/p1:Args/p1:Arg)[8]', 'nvarchar(max)') AS [UserInteractionMode]

,LDT.SDMPackageDigest.value('(/p1:AppMgmtDigest/p1:DeploymentType/p1:Installer/p1:Contents/p1:Content/p1:OnFastNetwork)[1]', 'nvarchar(max)') AS [OnFastNetwork]

,LDT.SDMPackageDigest.value('(/p1:AppMgmtDigest/p1:DeploymentType/p1:Installer/p1:Contents/p1:Content/p1:OnSlowNetwork)[1]', 'nvarchar(max)') AS [OnSlowNetwork]

,LDT.SDMPackageDigest.value('(/p1:AppMgmtDigest/p1:DeploymentType/p1:Installer/p1:DetectAction/p1:Provider)[1]', 'nvarchar(max)') AS DetectAction

FROM

dbo.fn_ListApplicationCIs(1033) LPC

RIGHT Join fn_ListDeploymentTypeCIs(1033) LDT ON LDT.AppModelName = LPC.ModelName

--where LDT.CIType_ID = 21 AND LDT.IsLatest = 1

) A

GROUP BY A.[App Name],A.Type,A.ContentLocation,A.InstallCommandLine,A.UninstallCommandLine,A.ExecutionContext,A.RequiresLogOn,A.UserInteractionMode,

A.OnFastNetwork,A.OnSlowNetwork,A.DetectAction


Trigger remote machine SCCM Baseline

 function Invoke-BLEvaluation {  param (  [String][Parameter(Mandatory=$true, Position=1)] $ComputerName,  [String][Parameter(Mandatory=$Fal...