smsclictr.automation library
Get the ExecutionRequest with the state "Running". If there is no Running Excution the function returns a NULL value

Namespace:  smsclictr.automation
Assembly:  smsclictr.automation(in smsclictr.automation.dll) Version: 1.1.3731.16627 (1.1.2.4)

Syntax

C#
public 
ManagementObject 
RunningAdv { 
get; }

Remarks

Returns a ManagementObject from the WMI Class root\ccm\SoftMgmtAgent:CCM_ExecutionRequest
CopyC#
[key] 
string ProgramID
[key] 
string TargetUser
[key] 
string AdvertID
[key] 
string ContentID
string ContentVersion
string State
boolean DependeePolicyExists
string RunningState
string ContentRequestGuid
datetime ReceivedTime
datetime NextRetryTime
uint32 RetryCount
uint32 ContentAccessRetryCount
uint32 RetryInterval
uint32 ProgramExitCode
boolean RunOnCompletion
boolean RunInQuietMode
boolean IsAdminContext
boolean DownloadStartedNotified
boolean ProgramReboot
boolean MIFChecking
string MIFFileName
string MIFPackageName
string MIFPackageVersion
string MIFPackagePublisher
string
ExecutionContextTempPath
string
OptionalAdvertisements[]
boolean DependencyCheckEvaluated
boolean IgnoreRunRerunFlags
uint32 ProcessID
uint32 ProcessCreationTimeLow
uint32 ProcessCreationTimeHigh
string LastStatusMessage

Examples

C#:
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");
			ManagementObject MO =
oClient.SoftwareDistribution.RunningAdv;
		
//Get the AdvertisementID of the
running Advertisement
			Console.WriteLine(MO.GetPropertyValue(
"AdvertID").ToString());
	}
}
}
PowerShell:

(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.RunningAdv.AdvertID

See Also