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

Remote install, say update is not needed but scan do not. #202

Open
Gilles92 opened this issue Oct 20, 2022 · 8 comments · Fixed by #204
Open

Remote install, say update is not needed but scan do not. #202

Gilles92 opened this issue Oct 20, 2022 · 8 comments · Fixed by #204

Comments

@Gilles92
Copy link

Hello,
i have an installation of windows 10 21H2, get-neededkbupdate point me to the latest patches to apply, but when i try an install-kbupdate on any package it tells me that i have nothing to do:
PS C:\windows\system32> Install-KbUpdate -ComputerName catswks11.XXXX.YYYYY -FilePath D:\share\kb\windows10.0-kb5017308-
x64_2027053968a06948b45d139d95475ab4feee5654.msu -Verbose
VERBOSE: [18:11:23][Install-KbUpdate] Processing catswks11.XXXX.YYYYY
VERBOSE: [18:11:23][Install-KbUpdate] Installing using DSC
VERBOSE: [18:11:23][Install-KbUpdate] Using jobs for update to catswks11.XXXX.YYYYY
VERBOSE: [18:11:24][Start-JobProcess] Processing jobs
VERBOSE: Exporting function 'Get-NetConnectionProfile'.
VERBOSE: Exporting function 'Set-NetConnectionProfile'.
VERBOSE: Exporting function 'New-PSWorkflowSession'.
VERBOSE: Exporting alias 'nwsn'.
VERBOSE: [18:12:06][Invoke-KbCommand] Computer is not localhost, adding catswks11.XXXX.YYYYY to
PSDefaultParameterValues
VERBOSE: [18:12:11][Invoke-KbCommand] Connecting to session using Invoke-PSFCommand
VERBOSE: [18:12:11][Invoke-PSFCommand] Invoking command against catswks11.XXXX.YYYYY
VERBOSE: [18:12:12][] Adding catswks11.XXXX.YYYYY to PSDefaultParameterValues for
Invoke-KbCommand:ComputerName
VERBOSE: [18:12:15][] Initializing remote session to catswks11.XXXX.YYYYY and also getting the
remote home directory
VERBOSE: [18:12:15][Invoke-KbCommand] Computer is not localhost, adding catswks11.XXXX.YYYYY to
PSDefaultParameterValues
VERBOSE: [18:12:15][Invoke-KbCommand] Connecting to session using Invoke-PSFCommand
VERBOSE: [18:12:15][Invoke-PSFCommand] Invoking command against catswks11.XXXX.YYYYY
VERBOSE: [18:12:15][] Checking for home downloads directory
VERBOSE: [18:12:15][Invoke-KbCommand] Computer is not localhost, adding catswks11.XXXX.YYYYY to
PSDefaultParameterValues
VERBOSE: [18:12:15][Invoke-KbCommand] Connecting to session using Invoke-PSFCommand
VERBOSE: [18:12:15][Invoke-PSFCommand] Invoking command against catswks11.XXXX.YYYYY
VERBOSE: [18:12:15][Invoke-KbCommand] Computer is not localhost, adding catswks11.XXXX.YYYYY to
PSDefaultParameterValues
VERBOSE: [18:12:15][Invoke-KbCommand] Connecting to session using Invoke-PSFCommand
VERBOSE: [18:12:15][Invoke-PSFCommand] Invoking command against catswks11.XXXX.YYYYY
VERBOSE: [18:12:16][Invoke-KbCommand] Computer is not localhost, adding catswks11.XXXX.YYYYY to
PSDefaultParameterValues
VERBOSE: [18:12:16][Invoke-KbCommand] Connecting to session using Invoke-PSFCommand
VERBOSE: [18:12:16][Invoke-PSFCommand] Invoking command against catswks11.XXXX.YYYYY
VERBOSE: [18:12:16][] Nothing to install on catswks11.XXXX.YYYYY, moving on
VERBOSE: [18:12:21][Start-JobProcess] Finished installing updates on catswks11.XXXX.YYYYY

I think i might miss something configured on the system as on other machines installed with a different process are successfull but i can"t find what...

Thanks for your help

@potatoqualitee
Copy link
Owner

thanks for the report, can you let me know what version you are using? get-module kbupdate. i had issues in earlier versions

@Gilles92
Copy link
Author

Hello i'm on the latest version.
One strange thing is if i do a local install, then after i can do a remote install.

Regards

@charlesBar01
Copy link

Hello,
I have the same problem as Gilles92. I have a lab with an AD and another domain member machine. when I try to install a remote KB from AD to the remote machine it starts working but it ends the same "nothing to install on XXXX, moving on"
I specify that on the remote machine I did not add the kbupdate module. Below are the logs:

Install-KbUpdate -ComputerName WKSADMCSP2A -FilePath "C:\windows10.0-kb5017270-x64_2060f8588180e3ad36a6169be2e06395227db418.cab" -Verbose
VERBOSE: [10:26:49][Install-KbUpdate] Processing WKSADMCSP2A
VERBOSE: [10:26:49][Install-KbUpdate] Installing using DSC
VERBOSE: [10:26:49][Install-KbUpdate] Using jobs for update to WKSADMCSP2A
VERBOSE: [10:26:49][Start-JobProcess] Processing jobs
VERBOSE: Exporting function 'Get-NetConnectionProfile'.
VERBOSE: Exporting function 'Set-NetConnectionProfile'.
VERBOSE: Exporting function 'New-PSWorkflowSession'.
VERBOSE: Exporting alias 'nwsn'.
VERBOSE: [10:27:48][Invoke-KbCommand] Computer is not localhost, adding WKSADMCSP2A to PSDefaultParameterValues
VERBOSE: [10:27:51][Invoke-KbCommand] Connecting to session using Invoke-PSFCommand
VERBOSE: [10:27:51][Invoke-PSFCommand] Invoking command against WKSADMCSP2A
VERBOSE: [10:27:52][] Adding WKSADMCSP2A to PSDefaultParameterValues for
Invoke-KbCommand:ComputerName
VERBOSE: [10:27:52][] Initializing remote session to WKSADMCSP2A and also getting the remote home
directory
VERBOSE: [10:27:52][Invoke-KbCommand] Computer is not localhost, adding WKSADMCSP2A to PSDefaultParameterValues
VERBOSE: [10:27:52][Invoke-KbCommand] Connecting to session using Invoke-PSFCommand
VERBOSE: [10:27:52][Invoke-PSFCommand] Invoking command against WKSADMCSP2A
VERBOSE: [10:27:53][] Checking for home downloads directory
VERBOSE: [10:27:53][Invoke-KbCommand] Computer is not localhost, adding WKSADMCSP2A to PSDefaultParameterValues
VERBOSE: [10:27:53][Invoke-KbCommand] Connecting to session using Invoke-PSFCommand
VERBOSE: [10:27:53][Invoke-PSFCommand] Invoking command against WKSADMCSP2A
VERBOSE: [10:27:53][Invoke-KbCommand] Computer is not localhost, adding WKSADMCSP2A to PSDefaultParameterValues
VERBOSE: [10:27:53][Invoke-KbCommand] Connecting to session using Invoke-PSFCommand
VERBOSE: [10:27:53][Invoke-PSFCommand] Invoking command against WKSADMCSP2A
VERBOSE: [10:27:53][Invoke-KbCommand] Computer is not localhost, adding WKSADMCSP2A to PSDefaultParameterValues
VERBOSE: [10:27:53][Invoke-KbCommand] Connecting to session using Invoke-PSFCommand
VERBOSE: [10:27:53][Invoke-PSFCommand] Invoking command against WKSADMCSP2A
VERBOSE: [10:27:53][] Copying xWindowsUpdate to WKSADMCSP2A (remote to C:\Program
Files\WindowsPowerShell\Modules\xWindowsUpdate)
VERBOSE: [10:27:55][Invoke-KbCommand] Computer is not localhost, adding WKSADMCSP2A to PSDefaultParameterValues
VERBOSE: [10:27:55][Invoke-KbCommand] Connecting to session using Invoke-PSFCommand
VERBOSE: [10:27:55][Invoke-PSFCommand] Invoking command against WKSADMCSP2A
VERBOSE: [10:27:55][] Adding xPSDesiredStateConfiguration to WKSADMCSP2A
VERBOSE: [10:27:55][Invoke-KbCommand] Computer is not localhost, adding WKSADMCSP2A to PSDefaultParameterValues
VERBOSE: [10:27:55][Invoke-KbCommand] Connecting to session using Invoke-PSFCommand
VERBOSE: [10:27:55][Invoke-PSFCommand] Invoking command against WKSADMCSP2A
VERBOSE: [10:27:55][] Copying xPSDesiredStateConfiguration to WKSADMCSP2A (remote)
VERBOSE: [10:28:05][] Nothing to install on WKSADMCSP2A, moving on
VERBOSE: [10:28:40][Start-JobProcess] Finished installing updates on WKSADMCSP2A

I see that it has copied in the programfile\windowsPowershell\Modules\ "Xwindowsupdate" and "xPSDesiredStateConfiguration", but this is not the case for the KBUDATE module and the others...
Are there any prerequisites for the remote machine?

  • import of kbupdate module before remote installation...
    -enable winrm, psremoting, execution policy etc...

Do you have an exhaustive list of things to respect before launching a remote installation?

@potatoqualitee
Copy link
Owner

Sweet, this will be helpful. Thank you. Unfortunately, I won't have time to return to kbupdate for probably a month.

kbupdate does not need to be copied to the remote system -- only the DSC modules. The only thing you need enabled is WinRM. It's not signed so you do need to modify your execution policy that works for you on the local machine. The remote machine does not need modifications as I use built-in commands and modules signed by Microsoft.

@potatoqualitee
Copy link
Owner

This will be released to the gallery sometime today

@potatoqualitee
Copy link
Owner

done!

@charlesBar01
Copy link

Hello potatoqualitee, Thank you very much for the latest update (2.17), it solved my problem :) .
But I found two other problems on a KB SQL (KB5014553):

  1. in remote, when i want to update sql server with big KB (KB5014553) around 600MB, it starts copying on remote machine then stops at around 110MB, below the message.
    PS C:\Users\Administrator> Install-KbUpdate -ComputerName CATSSRVL2A -FilePath "D:\KB\WinServer2019\400\SQL2017\sqlserver2017-kb5014553-x64_273bf6ee251f21ff3bfd0c906296a7644d20ee3c.exe" -Credential deploy -argumentlist "/IAcceptSQLServerLicenseTerms /Action=Patch /quietsimple /enu /InstanceName=MSSQLSERVER" -verbose
    VERBOSE: [19:28:39][Install-KbUpdate] Processing CATSSRVL2A VERBOSE: [19:28:40][Install-KbUpdate] Installing using DSC VERBOSE: [19:28:40][Install-KbUpdate] Using jobs for update to CATSSRVL2A VERBOSE: [19:28:40][Start-JobProcess] Processing jobs VERBOSE: Exporting function 'Get-NetConnectionProfile'. VERBOSE: Exporting function 'Set-NetConnectionProfile'. VERBOSE: Exporting function 'New-PSWorkflowSession'. VERBOSE: Exporting alias 'nwsn'. VERBOSE: [19:28:43][Invoke-KbCommand] Connecting to session using Invoke-PSFCommand VERBOSE: [19:28:43][Invoke-PSFCommand] Invoking command against CATSSRVL2A VERBOSE: [19:28:43][] Adding CATSSRVL2A to PSDefaultParameterValues for Invoke-KbCommand:ComputerName VERBOSE: [19:28:43][] Initializing remote session to CATSSRVL2A and also getting the remote home directory VERBOSE: [19:28:43][Invoke-KbCommand] Connecting to session using Invoke-PSFCommand
    VERBOSE: [19:28:43][Invoke-PSFCommand] Invoking command against CATSSRVL2A
    VERBOSE: [19:28:44][] Checking for home downloads directory
    VERBOSE: [19:28:44][Invoke-KbCommand] Connecting to session using Invoke-PSFCommand
    VERBOSE: [19:28:44][Invoke-PSFCommand] Invoking command against CATSSRVL2A
    VERBOSE: [19:28:44][Invoke-KbCommand] Connecting to session using Invoke-PSFCommand
    VERBOSE: [19:28:44][Invoke-PSFCommand] Invoking command against CATSSRVL2A
    VERBOSE: [19:28:44][Invoke-KbCommand] Connecting to session using Invoke-PSFCommand
    VERBOSE: [19:28:44][Invoke-PSFCommand] Invoking command against CATSSRVL2A
    VERBOSE: [19:28:44][] Setting InputObject to
    D:\KB\WinServer2019\400\SQL2017\sqlserver2017-kb5014553-x64_273bf6ee251f21ff3bfd0c906296a7644d20ee3c.exe
    VERBOSE: [19:28:44][] Update is not located on a file server and not local, copying over the
    remote server
    VERBOSE: [19:28:44][Invoke-KbCommand] Connecting to session using Invoke-PSFCommand
    VERBOSE: [19:28:44][Invoke-PSFCommand] Invoking command against CATSSRVL2A
    VERBOSE: [19:29:10][Invoke-KbCommand] Connecting to session using Invoke-PSFCommand
    VERBOSE: [19:29:10][Invoke-PSFCommand] Invoking command against CATSSRVL2A
    WARNING: [19:29:10][] Copy failed, trying again
    VERBOSE: [19:29:14][Invoke-KbCommand] Connecting to session using Invoke-PSFCommand
    VERBOSE: [19:29:14][Invoke-PSFCommand] Invoking command against CATSSRVL2A
    WARNING: [19:29:14][] Could not copy
    D:\KB\WinServer2019\400\SQL2017\sqlserver2017-kb5014553-x64_273bf6ee251f21ff3bfd0c906296a7644d20ee3c.exe to
    C:\Users\deploy\Downloads\sqlserver2017-kb5014553-x64_273bf6ee251f21ff3bfd0c906296a7644d20ee3c.exe | The process cannot
    access the file 'C:\Users\deploy\Downloads\sqlserver2017-kb5014553-x64_273bf6ee251f21ff3bfd0c906296a7644d20ee3c.exe'
    because it is being used by another process.
    VERBOSE: [19:29:23][Start-JobProcess] Finished installing updates on CATSSRVL2A

  2. locally when he installs this kb he informs us that he is installing correctly but when I check the installation in the control panel it is absent. So I tested also with argumentList with Start-process and install-kbupdate and the result is different. With start-process + argumentlist it works but not with install-kbupate.

So in order to bypass that I make a copy of the KB via new-session and install the KB via invoke-like { start-process ....}.
If you find a solution, I'm listening :)

@potatoqualitee
Copy link
Owner

thank you for the report! ill work in kbupdate again in about another month or two (working on dbatools 2.0 release). This will help 👍🏼

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

Successfully merging a pull request may close this issue.

3 participants