smsclictr.automation library
Assembly: smsclictr.automation(in smsclictr.automation.dll) Version: 1.1.3731.16627 (1.1.2.4)
Import a local Software Distribution Policy
for SCCM Clients
Namespace:
smsclictr.automation
Assembly: smsclictr.automation(in smsclictr.automation.dll) Version: 1.1.3731.16627 (1.1.2.4)
Syntax
C# |
---|
public ManagementObject ImportSCCMPolicy( string sPolicyPath, bool bPersistent ) |
Parameters
- sPolicyPath
- Type:
System
.
.
::
.
String
Path to the XML File or URL on the SMS ManagementPoint
- bPersistent
- Type:
System
.
.
::
.
Boolean
Create a persistant policy
Return Value
CCM_SoftwareDistribution ManagementObjectRemarks
Persistant policies will not be removed automatically.
Only a full/hard policy reset will remove these policies
Examples
C#:
PowerShell:
CopyC#
using System; using System.Collections.Generic; using System.Text; using smsclictr.automation; using System.Management; namespace ConsoleApplication1 { class Program { static void Main( string[] args) { SMSClient oClient = new SMSClient( "remotehost"); oClient.SoftwareDistribution.ImportSCCMPolicy( @"http://SMSServer/SMS_MP/.sms_pol?C0020004-C0000005-6F42AC19.2_00", true); } } }
(copy smsclictr.automation.dll to the %HOMEDRIVE%\%HOMEPATH% Folder of the current User)
CopyC#
[ void][System.Reflection.Assembly]::LoadFile( "$HOME\smsclictr.automation.dll") $SMSClient = New-Object -TypeName smsclictr.automation.SMSClient( "remotehost") $SMSClient.SoftwareDistribution.ImportSCCMPolicy( "http://SMSServer/SMS_MP/.sms_pol?C0020004-C0000005-6F42AC19.2_00", "True");