question

DineshVinay-3089 avatar image
0 Votes"
DineshVinay-3089 asked AllenLiu-MSFT answered

Powershell cmdlet to disable sync setting in SUP

Hi,

Hope everyone is doing well. Just would like to know, is there any powershell cmdlet to disable the "Enable Synchronization on schedule checkbox from Sync schedule tab in SUP component properties.

mem-mdt
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AllenLiu-MSFT avatar image
0 Votes"
AllenLiu-MSFT answered AllenLiu-MSFT commented

Hi, @DineshVinay-3089
Thank you for posting in Microsoft Q&A forum.
I test in my lab, the parameter 'EnableSynchronization' has been deprecated and may be removed in a future release. The parameter 'Schedule' may be used as a replacement.

So, the below cmdlet works:

 Set-CMSoftwareUpdatePointComponent -Schedule $null


If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

It seems there is no update for a couple of days. May we know the current status of the problem? Is there any other assistance we can provide?

0 Votes 0 ·
DineshVinay-3089 avatar image
0 Votes"
DineshVinay-3089 answered

Allen, Much appreciate for your support. That Powershell cmd is working like charm.

Just I need one more Powershell requirement.

I want to enable the Enable synchronization schedule checkbox again with custom schedule to recur every 6 hours.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AllenLiu-MSFT avatar image
0 Votes"
AllenLiu-MSFT answered

Hi, @DineshVinay-3089
Thank you for your feedback, to enable the schedule and set to every 6 hours, please try this:
$CusSch = New-CMSchedule -RecurInterval Hours -RecurCount 6
Set-CMSoftwareUpdatePointComponent -Schedule $CusSch


If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

DineshVinay-3089 avatar image
0 Votes"
DineshVinay-3089 answered

Allen, Much thanks for your support.

One more question, we have requirement to disable the sync settings to run before SUSDB clean-up through SQL maintenance plan and we need to enable the sync schedule back with custom internal after the SQL maintenance plan executed.

Would you please guide me that how to execute the sync powershell cmdlets in Windows Task scheduler?

Is there any powershell script or Task scheduler steps require to configure this, because It was failing when we tried to run the SCCM powershell cmdlets by putting it into notepad and converted into ps1 file that directly configured into task scheduler.

Share your view on this please.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AllenLiu-MSFT avatar image
0 Votes"
AllenLiu-MSFT answered

Hi, @DineshVinay-3089
Check below article to see if you are running SCCM PowerShell Scripts as a Service Account:
http://get-cmd.com/?p=4088
(Please note: Information posted in the given link is hosted by a third party. Microsoft does not guarantee the accuracy and effectiveness of information.)

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

DineshVinay-3089 avatar image
0 Votes"
DineshVinay-3089 answered DineshVinay-3089 edited

Allen, One more requirement, Is it possible to set Start date settings with current date and sync need to schedule at 6:00 AM



103395-customsync.jpg



Am able to take get date by using -start (Get-date) switch. But how to set at 6:00 AM Time in custom sync schedule setting



$CusSch = New-CMSchedule -Start (Get-Date) -RecurInterval Hours -RecurCount 6

Set-CMSoftwareUpdatePointComponent -Schedule $CusSch






customsync.jpg (23.4 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AllenLiu-MSFT avatar image
0 Votes"
AllenLiu-MSFT answered

Hi, @DineshVinay-3089
I think you do not need to use the (Get-Date), since your RecurInterval is 6 hours, so we just make sure the start date is earlier than the current date.
So you can always use the cmdlet:
$CusSch = New-CMSchedule -Start "6/8/2021 6:00 AM" -RecurInterval Hours -RecurCount 6
Set-CMSoftwareUpdatePointComponent -Schedule $CusSch

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.