Skip to content

Instantly share code, notes, and snippets.

@MarkusBux
MarkusBux / TargetedUpdatesOnDevices.sql
Created December 21, 2021 16:58
List all updates that are targeted on devices within ConfigMgr
;with XMLNamespaces(DEFAULT 'http://schemas.microsoft.com/SystemsCenterConfigurationManager/2009/07/10/DesiredConfiguration', 'http://schemas.microsoft.com/SystemsCenterConfigurationManager/2009/06/14/Rules' as ns1)
, cte as(
SELECT
UpdateGroupData.*
, ci.CI_ID as Update_CI_ID
, ci.SDMPackageDigest.value('(/DesiredConfigurationDigest/SoftwareUpdateBundle/ns1:Annotation/ns1:DisplayName/@Text)[1]', 'nvarchar(max)') as UpdateTitle
FROM (
SELECT ci.CI_ID as UpdateGroup_CI_ID
, cl.DisplayName as UpdateGroup_Name
@MarkusBux
MarkusBux / CustomDeviceProperties_Sample.ps1
Last active October 10, 2024 00:00
Samples for ConfigMgr Custom Device Properties available since ConfigMgr2107
# Samples to work with custom properties for devices
# https://docs.microsoft.com/en-us/mem/configmgr/develop/adminservice/custom-properties
# Specify Siteserver and Device
$provider = "<ConfigMgrFqdn>"
$resourceID = <ResourceIdOfDevice>
# Get all Custom Device Properties
$uri = "https://$provider/AdminService/v1.0/Device/AdminService.GetExtensionData"
Invoke-RestMethod -Method "Get" -Uri $uri -UseDefaultCredentials