-
Notifications
You must be signed in to change notification settings - Fork 7
/
How to invoke Client Notification actions
31 lines (28 loc) · 1.72 KB
/
How to invoke Client Notification actions
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
#Example 1
$WMIConnection = [WMICLASS]"\\CM01\Root\SMS\Site_PS1:SMS_ClientOperation"
$CMClientNotification = $WMIConnection.psbase.GetMethodParameters("InitiateClientOperation")
$CMClientNotification.Type = 8 # Download Computer Policy
$CMClientNotification.TargetCollectionID = "PS10000B"
$CMClientNotification.TargetResourceIDs = 16777224
$WMIConnection.psbase.InvokeMethod("InitiateClientOperation",$CMClientNotification,$Null)
#Example 2
$WMIConnection = [WMICLASS]"\\CM01\Root\SMS\Site_PS1:SMS_ClientOperation"
$CMClientNotification = $WMIConnection.psbase.GetMethodParameters("InitiateClientOperation")
$CMClientNotification.Type = 1 # Full Scan
$CMClientNotification.TargetCollectionID = "PS10000B"
$CMClientNotification.TargetResourceIDs = 16777224
$WMIConnection.psbase.InvokeMethod("InitiateClientOperation",$CMClientNotification,$Null)
#Example 3
$WMIConnection = [WMICLASS]"\\CM01\Root\SMS\Site_PS1:SMS_ClientOperation"
$CMClientNotification = $WMIConnection.psbase.GetMethodParameters("InitiateClientOperation")
$CMClientNotification.Type = 2 # Quick Scan
$CMClientNotification.TargetCollectionID = "PS10000B"
$CMClientNotification.TargetResourceIDs = 16777224
$WMIConnection.psbase.InvokeMethod("InitiateClientOperation",$CMClientNotification,$Null)
#Example 4
$WMIConnection = [WMICLASS]"\\CM01\Root\SMS\Site_PS1:SMS_ClientOperation"
$CMClientNotification = $WMIConnection.psbase.GetMethodParameters("InitiateClientOperation")
$CMClientNotification.Type = 4 # Download Definition
$CMClientNotification.TargetCollectionID = "PS10000B"
$CMClientNotification.TargetResourceIDs = 16777224
$WMIConnection.psbase.InvokeMethod("InitiateClientOperation",$CMClientNotification,$Null)