From 669136ec52056abaa98e90530eef147c6a3e715f Mon Sep 17 00:00:00 2001 From: Austin Date: Tue, 7 Jul 2020 17:39:06 -0400 Subject: [PATCH] Create DisableOldSoftwareUpdateGroups.ps1 --- DisableOldSoftwareUpdateGroups.ps1 | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 DisableOldSoftwareUpdateGroups.ps1 diff --git a/DisableOldSoftwareUpdateGroups.ps1 b/DisableOldSoftwareUpdateGroups.ps1 new file mode 100644 index 0000000..665ef8e --- /dev/null +++ b/DisableOldSoftwareUpdateGroups.ps1 @@ -0,0 +1,13 @@ +Import-Module “D:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin\ConfigurationManager.psd1” + +CD XXX: + +$currentdateminus30 = (get-date).adddays(-60) + +$deployments = get-cmsoftwareupdatedeployment | where-object {($_.CreationTime -le $currentdateminus30) -and ($_.AssignmentName -like "wks-Monthly*")} | select AssignmentName, AssignmentID, Enabled + +foreach($deployment in $deployments){ + + Set-cmupdategroupdeployment -DeploymentName $deployment.AssignmentName -Disable + +}