widsnet.com
4Jul/110

Set Binary Delta Replication on Packages

A follow-up post to http://widsnet.com/2011/06/update-distribution-points-on-a-schedule-vbscript/
Some packages didn't have the "Enable binary differential replication" checkbox enabled. That lead to a lot of unnecessary network traffic. So to avoid that this "add-on" script enables binary delta replication.

Const AP_USE_BINARY_DELTA_REP = &H04000000

setBinaryDeltaReplication objSMSConnection, strPackageID

Sub setBinaryDeltaReplication(objSMSConnection, strPackageID)
	Set colPkg = objSMSConnection.ExecQuery("Select * from SMS_Package where PackageID='" & strPackageID & "'")
	If colPkg.Count = 1 Then
		Set objPackage = objSMSConnection.Get("SMS_Package.PackageID='" & strPackageID & "'")
		If Not objPackage.PkgFlags And AP_USE_BINARY_DELTA_REP Then
			objPackage.PkgFlags = objPackage.PkgFlags OR AP_USE_BINARY_DELTA_REP
			objPackage.Put_
		End If
		If objPackage.PkgFlags And AP_USE_BINARY_DELTA_REP Then
			WScript.Echo strPackageID & " Delta Replication: Enabled"
		Else
			WScript.Echo strPackageID & " Delta Replication: Disabled!"
		End If
	End If
End Sub