Skip to content

Instantly share code, notes, and snippets.

@NathanTheGr8
Created December 13, 2019 21:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NathanTheGr8/124ce649a65f43e2d87f71a85848df68 to your computer and use it in GitHub Desktop.
Save NathanTheGr8/124ce649a65f43e2d87f71a85848df68 to your computer and use it in GitHub Desktop.
create a new SCCM Automatic Deployment Rule with powershell
$parms2 = @{
Description = "PS Test"
Name = "Windows Updates - Office 365 x86"
Path = "\\pathToFileShare\sccm\Software_Library\Updates\Windows Updates - Office 365 x86"
Priority = "Low"
}
New-CMSoftwareUpdateDeploymentPackage @parms2
$parms = @{
AddToExistingSoftwareUpdateGroup = $False
AlertTime = 2
AlertTimeUnit = "Weeks"
AllowRestart = $False
AllowSoftwareInstallationOutsideMaintenanceWindow = $True #
AllowUseMeteredNetwork = $false
#ArticleId = "test"
#AvailableImmediately = $False
AvailableTime = 1
AvailableTimeUnit = "Months"
CollectionName = "All Workstations"
#CustomSeverity = Critical
DateReleasedOrRevised = "Last1month"
#DeadlineImmediately = $False
DeadlineTime = 5
DeadlineTimeUnit = "Days"
DeployWithoutLicense = $True
DeploymentPackageName = "Windows Updates - Office 365 x86"
Description = "Testing PS cmdlets"
#DisableOperationManager = $True
#DownloadFromInternet = $False
DownloadFromMicrosoftUpdate = $False
EnabledAfterCreate = $False
#GenerateOperationManagerAlert = $False
GenerateSuccessAlert = $True
#Language = "English"
LanguageSelection = "English"
#Location = "\\k\aS_O15_Client_Dev_1"
Name = "Testing PS"
NoInstallOnRemote = $False
NoInstallOnUnprotected = $True
Product = @("Silverlight","Windows 7","Office 365 Client","Windows 10","Windows 10, version 1903 and later")
Required = ">=1"
RunType = "RunTheRuleOnSchedule"
Schedule = Convert-CMSchedule -ScheduleString "02CF8C4000331480"
<#
New-CMSchedule doesn't have offset value, so you have to create a schedule in the UI and then get the value
Occurs 2 day(s) after the Second Tuesday of every 1 months effective 8/15/2019 10:00 PM
#>
SendWakeUpPacket = $false
SuccessPercent = 80
Superseded = $False
SuppressRestartServer = $False
SuppressRestartWorkstation = $False
Title = @("-Security Only","-Preview of Quality")
UpdateClassification = @("Critical Updates","Security Updates","Updates")
UseBranchCache = $True
UserNotification = "DisplayAll"
UseUtc = $False
VerboseLevel = "AllMessages"
WriteFilterHandling = $True
}
New-CMSoftwareUpdateAutoDeploymentRule @parms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment