Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I want to be able to check the CCM Updates Schedule as seen in Configuration Manager Updates tab. I've been looking around on google and I've not been able to find a consistent answer to this.

I tried to create a COM object using UDA.CCMUpdatesDeployment. This allows me to successfully set the recurring schedule with SetUserDefinedSchedule method. If I try to use GetUserDefinedSchedule I only get the original values of the variables.

PS> $UD = New-Object -com "UDA.CCMUpdatesDeployment"
PS> $A= 101
PS> $B= 102
PS> $UD.GetUserDefinedSchedule([ref]$A, [ref]$B)
PS> $A
101
PS> $B
102
PS> $UD.GetUserDefinedSchedule

MemberType          : Method
OverloadDefinitions : {void GetUserDefinedSchedule (Variant, Variant)}
TypeNameOfValue     : System.Management.Automation.PSMethod
Value               : void GetUserDefinedSchedule (Variant, Variant)
Name                : GetUserDefinedSchedule
IsInstance          : True

I actually want to be able to do this remotely for a list of servers in a text file but right now any way would do.

share|improve this question

2 Answers 2

So I'm a complete newbie on Powershell.

My variables should have been declared:

PS> [ref]$A = $Null
PS> [ref]$B = $Null

Then the command should have been run as:

PS> $UD.GetUserDefinedSchedule($A,$B)

Result for every Sunday at 3 AM is:

PS> $A
Value
-----
    1
PS> $B
Value
-----
    3

First variable is an index of the various options available in the drop down box. Second variable contains the time in 24 hour format. So 3 PM will give value 15.

I got the answer while browsing through some powershell code. I was thinking of pass by reference as a C function to update the same variable. I still don't understand the concept in Powershell. If I update CCM and run the command using the same variables the value does not change.

share|improve this answer

Can you give this a go? Notice the way the parameters are passed in Powershell.

$A = $null
$B = $null
$UD.GetUserDefinedSchedule ([ref]$A) ([ref]$B)
write-host "Recurrence: $A"
write-host "Hour: $B"
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.