# Remotely Install available OS update from Software center

**URL:** <https://forums.powershell.org/t/remotely-install-available-os-update-from-software-center/17445>\
**Category:** PowerShell Help\
**Created:** [August 30, 2021, 11:04pm UTC](https://forums.powershell.org/t/remotely-install-available-os-update-from-software-center/17445 "2021-08-30T23:04:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rahul20](https://avatars.discourse-cdn.com/v4/letter/r/838e76/32.png) [@Rahul20](https://forums.powershell.org/u/Rahul20)\
**Post date:** [August 30, 2021, 11:04pm UTC](https://forums.powershell.org/t/remotely-install-available-os-update-from-software-center/17445/1 "2021-08-30T23:04:59Z")

</div>

Hello All,

can someone help me how can I install available OS update from Software center on remote computer.

Usually these are pushed from SCCM and I would like to install on the client machine and it is on Operating systems tab of Software center.

---

<div class="post-metadata">

**Author:** ![Olaf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/olaf/32/992_2.png) [@Olaf](https://forums.powershell.org/u/Olaf)\
**Post date:** [August 31, 2021, 5:37am UTC](https://forums.powershell.org/t/remotely-install-available-os-update-from-software-center/17445/2 "2021-08-31T05:37:23Z")

</div>

Here is something I wrote time ago for this purpose:

```auto
if (Test-Connection -TargetName $ComputerName -Count 1 -TimeoutSeconds 1 -Quiet) {
    $NewPSSessionParams = @{
        ComputerName = $ComputerName
    }
    if ($Credential) {
        $NewPSSessionParams.Credential = $Credential
    }
    $PSSession = New-PSSession @NewPSSessionParams
    Invoke-Command -Session $PSSession -ScriptBlock {
        try {
            $GetCimInstanceParams = @{
                NameSpace = 'ROOT\ccm\ClientSDK'
                ClassName = 'CCM_SoftwareUpdate'
                Filter = 'ComplianceState = 0'
                ErrorAction = 'Stop'
            }
            $InvokeCimMethodParams = @{
                Namespace = 'ROOT\ccm\ClientSDK' 
                ClassName = 'CCM_SoftwareUpdatesManager'
                MethodName = 'InstallUpdates'
                Arguments = @{ 
                    CCMUpdates = [ciminstance[]](Get-CimInstance @GetCimInstanceParams | Where-Object -Property 'ArticleID' -NotIn -Value $USING:ExcludeArticleID) 
                }
                ErrorAction = 'Stop'
            }
            Invoke-CimMethod @InvokeCimMethodParams
        }
        catch {
            throw $_
            Write-Error "Error activating updates on '$($ComputerName)'"
        }
    }
    Remove-PSSession -Session $PSSession
}
else {
    Write-Warning -Message "Cannot connect to '$($ComputerName)'"
}

```

**It’s been tested with PowerShell v 7.1.2.**  
`$ComputerName` is one or more computer names, `$Credential` is a credential object you can provide if needed to reach some computers if the account you’re currently using is not allowed and `$ExcludeArticleID` is one or more `ArticleIDs` you don’t want to install.

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:21pm UTC](https://forums.powershell.org/t/remotely-install-available-os-update-from-software-center/17445/3 "2024-05-16T20:21:40Z")

</div>


