Thursday, June 18, 2015

Initiate a machine policy or user policy on the client machine/members of a collection

Very useful command which can trigger the client machine policy/user policy action. Can be triggered for a device or a collection.

Whenever I deploy an application to a set of my test machines, I would trigger this action from the SCCM powershell console which would make the deployment available quickly on the machine.




Invoke-CMClientNotification -DeviceCollectionName "CollectionName" -NotificationType RequestMachinePolicyNow -Verbose 


Friday, June 5, 2015

Powershell:SCCM2012:How to enable Binary Differential Replication or Delta Replication property of a package

Function enableDeltaReplication($SiteServer,$SiteCode,$Namespace,$pkgId)
    $USE_BINARY_DELTA_REP = "0x04000000" #Property of SMS_PackageBaseclass for Delta replication. Refer:

    $myPackage = Get-WmiObject -Namespace $Namespace -ComputerName $SiteServer -Query "SELECT *  FROM SMS_PackageBaseclass Where PackageID = '${pkgId}'"
    $res=$myPackage.PkgFlags -bor $USE_BINARY_DELTA_REP

    $myPackage = Get-WmiObject -Namespace $Namespace -ComputerName $SiteServer -Query "SELECT *  FROM SMS_PackageBaseclass Where PackageID = '${pkgId}'"
    if($myPackage.PkgFlags -band $USE_BINARY_DELTA_REP) {return $true} Else {return $false}

# $pkgid = package id of the package to enable binary differential replication

#refer get-cmpackage to obtain package id.

$siteCode="SITE_CODE" #Your CAS site code$replRes=enableDeltaReplication "Your_CAS_ServerName" $siteCode "root\sms\site_$($SiteCode)" $pkgid

Write-Host "Binary replication result ${replRes}"