Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancements request: Update "Detect Now" command for Windows 10 #5

Open
StyleTec opened this issue Jun 6, 2019 · 1 comment
Open
Labels
feature WPP V2 Ask for new feature in WPP V2
Milestone

Comments

@StyleTec
Copy link

StyleTec commented Jun 6, 2019

From Windows 10 on, the "wuauclt /detectnow" command is no longer working and replaced by "usoclient StartScan". Could you please change the behaviour for Windows 10 clients. The metadata which version the client has, should be available from WSUS database.

@DCourtel DCourtel added the feature WPP V2 Ask for new feature in WPP V2 label Jun 9, 2019
@DCourtel DCourtel added this to the WPP V2 milestone Jun 9, 2019
@tb-mtg
Copy link

tb-mtg commented May 12, 2021

On our Windows 10 clients be use psexec and powershell scripts below:

To detect:

  • PSEXEC -s \ComputerName powershell.exe -ExecutionPolicy Bypass -File WSUS-Detect.ps1

To install:

  • PSEXEC -s \ComputerName powershell.exe -ExecutionPolicy Bypass -File WSUS-Install.ps1

WSUS-Detect.ps1

$Session = New-Object -Com Microsoft.Update.Session
$Searcher = $Session.CreateUpdateSearcher()
$SearchResult = $Searcher.Search("IsInstalled=0").Updates
Write-Output $SearchResult.Count

WSUS-Install.ps1

$Session = New-Object -Com Microsoft.Update.Session
$Searcher = $Session.CreateUpdateSearcher()
$SearchResult = $Searcher.Search("IsInstalled=0").Updates
try { 
  $Downloader = $Session.CreateUpdateDownloader()
  $Downloader.Updates = $SearchResult
  $Downloader.Download()

  $Installer = $Session.CreateUpdateInstaller()
  $Installer.Updates = $SearchResult
  $InstallResult = $Installer.Install()
} catch {
  if($_.Exception.HResult -eq -2145124330) {
    Write-Host "There is either an update in progress or there is a pending reboot blocking the install."
  } else { 
    Write-Host "There is was an error trying to install an update."
  }
  Continue
}

This might help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature WPP V2 Ask for new feature in WPP V2
Projects
None yet
Development

No branches or pull requests

3 participants