Skip to content

Commit

Permalink
Create DisableOldSoftwareUpdateGroups.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
ayockel authored Jul 7, 2020
1 parent f22f6c4 commit 669136e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions DisableOldSoftwareUpdateGroups.ps1
Original file line number Diff line number Diff line change
@@ -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

}

0 comments on commit 669136e

Please sign in to comment.