-
Notifications
You must be signed in to change notification settings - Fork 7
/
How to create Software Update Group Deployment
39 lines (38 loc) · 2.08 KB
/
How to create Software Update Group Deployment
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
$StartDate = ([System.Management.ManagementDateTimeconverter]::ToDmtfDateTime((Get-Date))).Split(".")[0]
$Deadline = ([System.Management.ManagementDateTimeconverter]::ToDmtfDateTime((Get-Date).AddDays(7))).Split(".")[0]
$Updates = 16787514,16787565,16787577,16787651,16787663
$WMIConnection = [WMICLASS]"\\Localhost\Root\SMS\Site_PS1:SMS_UpdateGroupAssignment"
$NewSUPDeployment = $WMIConnection.psbase.CreateInstance()
$NewSUPDeployment.ApplyToSubTargets = $False
$NewSUPDeployment.AssignedCIs = $Updates #Software Updates that are in Software Update Group
$NewSUPDeployment.AssignedUpdateGroup = 16789635 #Software Update Group CI_ID
$NewSUPDeployment.AssignmentAction = 2
$NewSUPDeployment.AssignmentName = "SUM 2013 06 June"
$NewSUPDeployment.AssignmentType = 5
$NewSUPDeployment.ContainsExpiredUpdates = $False
$NewSUPDeployment.CreationTime = "$StartDate.000000+***"
$NewSUPDeployment.DesiredConfigType = 1
$NewSUPDeployment.DisableMomAlerts = $False
$NewSUPDeployment.DPLocality = 80
$NewSUPDeployment.Enabled = $True
$NewSUPDeployment.EnforcementDeadline = "$Deadline.000000+***"
$NewSUPDeployment.LimitStateMessageVerbosity = $False
$NewSUPDeployment.LocaleID = 1033
$NewSUPDeployment.LogComplianceToWinEvent = $False
$NewSUPDeployment.NotifyUser = $False
$NewSUPDeployment.OverrideServiceWindows = $False
$NewSUPDeployment.PersistOnWriteFilterDevices = $False
$NewSUPDeployment.RaiseMomAlertsOnFailure = $False
$NewSUPDeployment.RebootOutsideOfServiceWindows = $False
$NewSUPDeployment.SendDetailedNonComplianceStatus = $False
$NewSUPDeployment.StartTime = "$StartDate.000000+***"
$NewSUPDeployment.StateMessagePriority = 5
$NewSUPDeployment.StateMessageVerbosity = 1
$NewSUPDeployment.SuppressReboot = $False
$NewSUPDeployment.TargetCollectionID = "SMS00001"
$NewSUPDeployment.UseBranchCache = $True
$NewSUPDeployment.UseGMTTimes = $False
$NewSUPDeployment.UserUIExperience = $True
$NewSUPDeployment.WoLEnabled = $True
$NewSUPDeployment.SourceSite = "PS1"
$NewSUPDeployment.Put()