Skip to main content
deleted 26 characters in body
Source Link
Martin Brisiak
  • 4.1k
  • 12
  • 40
  • 51

I recently updated PSWindowsUpdate from version 1.6.1.1 to the latest version (2.1.0.1) and when I try to run the script:

Write-Host "      Centralized Update"
Write-Host "================================"

ipmo activedirectory
$computers = Get-ADComputer -Filter {enabled -eq $true} -properties * -SearchBase "OU=Workstations, DC=contoso, DC=com" | select name
$Script = {ipmo PSWindowsUpdate; Get-WUInstall -AcceptAll -Install -Verbose}

foreach ($computer in $computers) {
    Write-Host "Running update on:" $computer.name
    Invoke-WUJob -ComputerName $computer.name -Script $Script -Confirm:$false -RunNow
}

Write-Host "================================"
pause

I get the following error:

Invoke-WUJob : The system cannot find the file specified. (Exception from HRESULT: 0x80070002) At C:\Users\Administrator\Desktop\Update_Workstations.ps1:10 char:2

  • Invoke-WUJob -ComputerName $computer.name -Script $Script -Confir ...
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Invoke-WUJob], FileNotFoundException
    • FullyQualifiedErrorId : System.IO.FileNotFoundException,PSWindowsUpdate.InvokeWUJob
Invoke-WUJob : The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
At C:\Users\Administrator\Desktop\Update_Workstations.ps1:10
char:2
+     Invoke-WUJob -ComputerName $computer.name -Script $Script -Confir ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Invoke-WUJob], FileNotFoundException
    + FullyQualifiedErrorId : System.IO.FileNotFoundException,PSWindowsUpdate.InvokeWUJob

The only edit to the script was to change:

Invoke-WUInstall -ComputerName $computer.name -Script $Script -Confirm:$false

To:

Invoke-WUJob -ComputerName $computer.name -Script $Script -Confirm:$false -RunNow

More details:

  • The version of PowerShell is 5.1 (both client and server side)
  • The list of terminals is correctly extracted from the "Workstations" organizational unit
  • I can connect via "enter-pssession" to all the terminals without problems
  • Using "Invoke-Command" instead of "Invoke-WUJob" run but fails at the time of download with the error "UnauthorizedAccessException"

What's wrong with the code ? before updating to version 2.1.0.1 it works fine

I recently updated PSWindowsUpdate from version 1.6.1.1 to the latest version (2.1.0.1) and when I try to run the script:

Write-Host "      Centralized Update"
Write-Host "================================"

ipmo activedirectory
$computers = Get-ADComputer -Filter {enabled -eq $true} -properties * -SearchBase "OU=Workstations, DC=contoso, DC=com" | select name
$Script = {ipmo PSWindowsUpdate; Get-WUInstall -AcceptAll -Install -Verbose}

foreach ($computer in $computers) {
  Write-Host "Running update on:" $computer.name
  Invoke-WUJob -ComputerName $computer.name -Script $Script -Confirm:$false -RunNow
}

Write-Host "================================"
pause

I get the following error:

Invoke-WUJob : The system cannot find the file specified. (Exception from HRESULT: 0x80070002) At C:\Users\Administrator\Desktop\Update_Workstations.ps1:10 char:2

  • Invoke-WUJob -ComputerName $computer.name -Script $Script -Confir ...
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Invoke-WUJob], FileNotFoundException
    • FullyQualifiedErrorId : System.IO.FileNotFoundException,PSWindowsUpdate.InvokeWUJob

The only edit to the script was to change:

Invoke-WUInstall -ComputerName $computer.name -Script $Script -Confirm:$false

To:

Invoke-WUJob -ComputerName $computer.name -Script $Script -Confirm:$false -RunNow

More details:

  • The version of PowerShell is 5.1 (both client and server side)
  • The list of terminals is correctly extracted from the "Workstations" organizational unit
  • I can connect via "enter-pssession" to all the terminals without problems
  • Using "Invoke-Command" instead of "Invoke-WUJob" run but fails at the time of download with the error "UnauthorizedAccessException"

What's wrong with the code ? before updating to version 2.1.0.1 it works fine

I recently updated PSWindowsUpdate from version 1.6.1.1 to the latest version (2.1.0.1) and when I try to run the script:

Write-Host "      Centralized Update"
Write-Host "================================"

ipmo activedirectory
$computers = Get-ADComputer -Filter {enabled -eq $true} -properties * -SearchBase "OU=Workstations, DC=contoso, DC=com" | select name
$Script = {ipmo PSWindowsUpdate; Get-WUInstall -AcceptAll -Install -Verbose}

foreach ($computer in $computers) {
    Write-Host "Running update on:" $computer.name
    Invoke-WUJob -ComputerName $computer.name -Script $Script -Confirm:$false -RunNow
}

Write-Host "================================"
pause

I get the following error:

Invoke-WUJob : The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
At C:\Users\Administrator\Desktop\Update_Workstations.ps1:10
char:2
+     Invoke-WUJob -ComputerName $computer.name -Script $Script -Confir ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Invoke-WUJob], FileNotFoundException
    + FullyQualifiedErrorId : System.IO.FileNotFoundException,PSWindowsUpdate.InvokeWUJob

The only edit to the script was to change:

Invoke-WUInstall -ComputerName $computer.name -Script $Script -Confirm:$false

To:

Invoke-WUJob -ComputerName $computer.name -Script $Script -Confirm:$false -RunNow

More details:

  • The version of PowerShell is 5.1 (both client and server side)
  • The list of terminals is correctly extracted from the "Workstations" organizational unit
  • I can connect via "enter-pssession" to all the terminals without problems
  • Using "Invoke-Command" instead of "Invoke-WUJob" run but fails at the time of download with the error "UnauthorizedAccessException"

What's wrong with the code ? before updating to version 2.1.0.1 it works fine

more test
Source Link
Danfossi
  • 179
  • 1
  • 3
  • 18

I recently updated PSWindowsUpdate from version 1.6.1.1 to the latest version (2.1.0.1) and when I try to run the script:

Write-Host "      Centralized Update"
Write-Host "================================"

ipmo activedirectory
$computers = Get-ADComputer -Filter {enabled -eq $true} -properties * -SearchBase "OU=Workstations, DC=contoso, DC=com" | select name
$Script = {ipmo PSWindowsUpdate; Get-WUInstall -AcceptAll -Install -Verbose}

foreach ($computer in $computers) {
  Write-Host "Running update on:" $computer.name
  Invoke-WUJob -ComputerName $computer.name -Script $Script -Confirm:$false -RunNow
}

Write-Host "================================"
pause

I get the following error:

Invoke-WUJob : The system cannot find the file specified. (Exception from HRESULT: 0x80070002) At C:\Users\Administrator\Desktop\Update_Workstations.ps1:10 char:2

  • Invoke-WUJob -ComputerName $computer.name -Script $Script -Confir ...
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Invoke-WUJob], FileNotFoundException
    • FullyQualifiedErrorId : System.IO.FileNotFoundException,PSWindowsUpdate.InvokeWUJob

The only edit to the script was to change:

Invoke-WUInstall -ComputerName $computer.name -Script $Script -Confirm:$false

To:

Invoke-WUJob -ComputerName $computer.name -Script $Script -Confirm:$false -RunNow

More details:

  • The version of PowerShell is 5.1 (both client and server side)
  • The list of terminals is correctly extracted from the "Workstations" organizational unit
  • I can connect via "enter-pssession" to all the terminals without problems
  • Using "Invoke-Command" instead of "Invoke-WUJob" run but fails at the time of download with the error "UnauthorizedAccessException"

What's wrong with the code ? before updating to version 2.1.0.1 it works fine

I recently updated PSWindowsUpdate from version 1.6.1.1 to the latest version (2.1.0.1) and when I try to run the script:

Write-Host "      Centralized Update"
Write-Host "================================"

ipmo activedirectory
$computers = Get-ADComputer -Filter {enabled -eq $true} -properties * -SearchBase "OU=Workstations, DC=contoso, DC=com" | select name
$Script = {ipmo PSWindowsUpdate; Get-WUInstall -AcceptAll -Install -Verbose}

foreach ($computer in $computers) {
  Write-Host "Running update on:" $computer.name
  Invoke-WUJob -ComputerName $computer.name -Script $Script -Confirm:$false -RunNow
}

Write-Host "================================"
pause

I get the following error:

Invoke-WUJob : The system cannot find the file specified. (Exception from HRESULT: 0x80070002) At C:\Users\Administrator\Desktop\Update_Workstations.ps1:10 char:2

  • Invoke-WUJob -ComputerName $computer.name -Script $Script -Confir ...
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Invoke-WUJob], FileNotFoundException
    • FullyQualifiedErrorId : System.IO.FileNotFoundException,PSWindowsUpdate.InvokeWUJob

The only edit to the script was to change:

Invoke-WUInstall -ComputerName $computer.name -Script $Script -Confirm:$false

To:

Invoke-WUJob -ComputerName $computer.name -Script $Script -Confirm:$false -RunNow

More details:

  • The version of PowerShell is 5.1 (both client and server side)
  • The list of terminals is correctly extracted from the "Workstations" organizational unit
  • I can connect via "enter-pssession" to all the terminals without problems

What's wrong with the code ? before updating to version 2.1.0.1 it works fine

I recently updated PSWindowsUpdate from version 1.6.1.1 to the latest version (2.1.0.1) and when I try to run the script:

Write-Host "      Centralized Update"
Write-Host "================================"

ipmo activedirectory
$computers = Get-ADComputer -Filter {enabled -eq $true} -properties * -SearchBase "OU=Workstations, DC=contoso, DC=com" | select name
$Script = {ipmo PSWindowsUpdate; Get-WUInstall -AcceptAll -Install -Verbose}

foreach ($computer in $computers) {
  Write-Host "Running update on:" $computer.name
  Invoke-WUJob -ComputerName $computer.name -Script $Script -Confirm:$false -RunNow
}

Write-Host "================================"
pause

I get the following error:

Invoke-WUJob : The system cannot find the file specified. (Exception from HRESULT: 0x80070002) At C:\Users\Administrator\Desktop\Update_Workstations.ps1:10 char:2

  • Invoke-WUJob -ComputerName $computer.name -Script $Script -Confir ...
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Invoke-WUJob], FileNotFoundException
    • FullyQualifiedErrorId : System.IO.FileNotFoundException,PSWindowsUpdate.InvokeWUJob

The only edit to the script was to change:

Invoke-WUInstall -ComputerName $computer.name -Script $Script -Confirm:$false

To:

Invoke-WUJob -ComputerName $computer.name -Script $Script -Confirm:$false -RunNow

More details:

  • The version of PowerShell is 5.1 (both client and server side)
  • The list of terminals is correctly extracted from the "Workstations" organizational unit
  • I can connect via "enter-pssession" to all the terminals without problems
  • Using "Invoke-Command" instead of "Invoke-WUJob" run but fails at the time of download with the error "UnauthorizedAccessException"

What's wrong with the code ? before updating to version 2.1.0.1 it works fine

Source Link
Danfossi
  • 179
  • 1
  • 3
  • 18

PSWindowsUpdate File Not Found Exception

I recently updated PSWindowsUpdate from version 1.6.1.1 to the latest version (2.1.0.1) and when I try to run the script:

Write-Host "      Centralized Update"
Write-Host "================================"

ipmo activedirectory
$computers = Get-ADComputer -Filter {enabled -eq $true} -properties * -SearchBase "OU=Workstations, DC=contoso, DC=com" | select name
$Script = {ipmo PSWindowsUpdate; Get-WUInstall -AcceptAll -Install -Verbose}

foreach ($computer in $computers) {
  Write-Host "Running update on:" $computer.name
  Invoke-WUJob -ComputerName $computer.name -Script $Script -Confirm:$false -RunNow
}

Write-Host "================================"
pause

I get the following error:

Invoke-WUJob : The system cannot find the file specified. (Exception from HRESULT: 0x80070002) At C:\Users\Administrator\Desktop\Update_Workstations.ps1:10 char:2

  • Invoke-WUJob -ComputerName $computer.name -Script $Script -Confir ...
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Invoke-WUJob], FileNotFoundException
    • FullyQualifiedErrorId : System.IO.FileNotFoundException,PSWindowsUpdate.InvokeWUJob

The only edit to the script was to change:

Invoke-WUInstall -ComputerName $computer.name -Script $Script -Confirm:$false

To:

Invoke-WUJob -ComputerName $computer.name -Script $Script -Confirm:$false -RunNow

More details:

  • The version of PowerShell is 5.1 (both client and server side)
  • The list of terminals is correctly extracted from the "Workstations" organizational unit
  • I can connect via "enter-pssession" to all the terminals without problems

What's wrong with the code ? before updating to version 2.1.0.1 it works fine