Get The Scoop On What's New
Want to know what Plugins4Automate is doing for ConnectWise Automate? Come check out our blog and find out about new products and updates that we are working on! https://www.plugins4labtech.com/blogs/blog

Updating Powershell with PoSH

rmcclure
Posts: 6
Joined: Tue Aug 21, 2018 5:13 pm

Updating Powershell with PoSH

Post by rmcclure » Fri Sep 21, 2018 5:42 pm

Good Afternoon!

I've been struggling to get Powershell versions upgraded using the PoSH plugin. Most of the servers that I have tried pushing the update through the plugin have not updated.

Two entries are generated under Scripts on the endpoint:

Information: Powershell update to 4 has been started.
Result: The Script(6169) was successful in the Else section.

Script: S6169 - Starting at Server Time: Monday, September 17, 2018 12:15:47 AM
Script step logging has been disabled. Please set @ScriptEngineEnableLogger@ = True in your script to enable function logging.

The endpoint that I am testing against is running the follow:
Windows OS - Server 2012 Standard
.Net:
DELETE FROM `plugin_sw_powershell_dotnet_versions` WHERE ComputerID = '3714' ; INSERT IGNORE INTO `plugin_sw_powershell_dotnet_versions` (ClientID,ComputerID,NetName,NetVersion,NetRelease) Values ('2', '3714', 'Client (4.6.1)', '4.6.01055', '394271')
,('2', '3714', 'Full (4.6.1)', '4.6.01055', '394271')
,('2', '3714', 'Client', '4.0.0.0', '')
Powershell:
REPLACE INTO `plugin_sw_powershell_versions` (ClientID,LocationID,ComputerID,Major,Minor,Build,Revision,LastScan) Values (2,316,3714,'3','0','-1','-1',NOW())


Our environment has a lot of Powershell version 2 and 3 installed in it that we need to get to version 4 at a minimum. Getting this to work will save me a tremendous amount of time.

Thank you
- Robert

User avatar
Cubert
Posts: 1115
Joined: Tue Dec 29, 2015 7:57 pm
Contact:

Re: Updating Powershell with PoSH

Post by Cubert » Tue Sep 25, 2018 3:37 pm

Robert, Can you send us the results of the commands tab during the script run. We need to see the return.

rmcclure
Posts: 6
Joined: Tue Aug 21, 2018 5:13 pm

Re: Updating Powershell with PoSH

Post by rmcclure » Tue Dec 11, 2018 3:20 pm

Is this what your looking for? I ran the upgrade to Powershell 4 against a machine that the plugin is showing as Powershell 3. After the script completed the server did not reboot and Powershell still reports at being on version 3.

Execute Command - Success - 12/11/2018 9:21:01 AM
Parameter:
cmd.exe!!! /c "@powershell -NoProfile -ExecutionPolicy unrestricted -Command $PSVersionTable.PSVersion.Major"
Output: 3

Scripting KeepAlive - Success - 12/11/2018 9:21:17 AM
Parameter:
15
Output:
OK

Invoke Script - Success - 9/21/2018 9:21:19 AM
Parameter:
1|t+3W7tDAxeTWTQn5C/bVxZDKGwLrfLBoJfIQY1BoKWy4PxqGj9BC1w7zG4XQJkCtOeLHdL4XUB8iOAo9a897LWByVE2tOPQ8AIu59mBmbaII1gYQjg9F1cxqKeenGXRuLzKzztmlp4bKzDa1OOA2D8ubghOu2ly5Q3QkkW+H6dcR84QOn67vwRv0yAecpfhXGJpRcN0JuDD/XwNvyJw6pFCsbL8iYxTYWTayVt9m7LRj0O8iCAxGQ5Mhlk0/g8bE9d/lFCZ0gMkIo6wc7tsSeI8QetNvAs7AW3dQe9hj7RSirWRM0q5W2xorVmY4r0XKG7HwI6dYg10TYnFuYjkban+1VeLmrm/r|t+3W7tDAxeS+6CYhhD1YbVhOHsuyZygw|t+3W7tDAxeS+6CYhhD1YbVhOHsuyZygw|t+3W7tDAxeS+6CYhhD1YbVhOHsuyZygw
Output:
4.6.01055|4.6.01055|4.0.0.0|

DownLoad URL - Success - 12/11/2018 9:21:31 AM
Parameter:
https://download.microsoft.com/download ... 819745.msu
Output:
OK Downloaded File https://download.microsoft.com/download ... ltiPkg.msu and saved as %windir%\ltsvc\Windows6.1-KB2819745.msu

Execute Command - Success - 12/11/2018 9:21:36 AM
Parameter:
cmd.exe!!! /c "wusa %windir%\ltsvc\Windows6.1-KB2819745.msu /quiet /forcereboot"
Output:
OK

Scripting KeepAlive - Success - 12/11/2018 9:21:47 AM
Parameter:
15
Output:
OKIs this what your looking for? I ran the upgrade to Powershell 4 against a machine that the plugin is showing as Powershell 3. After the script completed the server did not reboot and Powershell still reports at being on version 3.

Execute Command - Success - 12/11/2018 9:21:01 AM
Parameter:
cmd.exe!!! /c "@powershell -NoProfile -ExecutionPolicy unrestricted -Command $PSVersionTable.PSVersion.Major"
Output: 3

Scripting KeepAlive - Success - 12/11/2018 9:21:17 AM
Parameter:
15
Output:
OK

Invoke Script - Success - 9/21/2018 9:21:19 AM
Parameter:
1|t+3W7tDAxeTWTQn5C/bVxZDKGwLrfLBoJfIQY1BoKWy4PxqGj9BC1w7zG4XQJkCtOeLHdL4XUB8iOAo9a897LWByVE2tOPQ8AIu59mBmbaII1gYQjg9F1cxqKeenGXRuLzKzztmlp4bKzDa1OOA2D8ubghOu2ly5Q3QkkW+H6dcR84QOn67vwRv0yAecpfhXGJpRcN0JuDD/XwNvyJw6pFCsbL8iYxTYWTayVt9m7LRj0O8iCAxGQ5Mhlk0/g8bE9d/lFCZ0gMkIo6wc7tsSeI8QetNvAs7AW3dQe9hj7RSirWRM0q5W2xorVmY4r0XKG7HwI6dYg10TYnFuYjkban+1VeLmrm/r|t+3W7tDAxeS+6CYhhD1YbVhOHsuyZygw|t+3W7tDAxeS+6CYhhD1YbVhOHsuyZygw|t+3W7tDAxeS+6CYhhD1YbVhOHsuyZygw
Output:
4.6.01055|4.6.01055|4.0.0.0|

DownLoad URL - Success - 12/11/2018 9:21:31 AM
Parameter:
https://download.microsoft.com/download ... 819745.msu
Output:
OK Downloaded File https://download.microsoft.com/download ... ltiPkg.msu and saved as %windir%\ltsvc\Windows6.1-KB2819745.msu

Execute Command - Success - 12/11/2018 9:21:36 AM
Parameter:
cmd.exe!!! /c "wusa %windir%\ltsvc\Windows6.1-KB2819745.msu /quiet /forcereboot"
Output:
OK

Scripting KeepAlive - Success - 12/11/2018 9:21:47 AM
Parameter:
15
Output:
OK

User avatar
Cubert
Posts: 1115
Joined: Tue Dec 29, 2015 7:57 pm
Contact:

Re: Updating Powershell with PoSH

Post by Cubert » Tue Dec 11, 2018 6:08 pm

Ok A couple of more questions.

What is the OS we are working with? Win 7 Win 10 Etc...

Next if you execute manually on the same agent as before that reports version 3. Log in to the desktop and open a admin command line console on desktop. Copy the following into the command window and run it.

Code: Select all

wusa %windir%\ltsvc\Windows6.1-KB2819745.msu /quiet /forcereboot
What does DOS report back?

rmcclure
Posts: 6
Joined: Tue Aug 21, 2018 5:13 pm

Re: Updating Powershell with PoSH

Post by rmcclure » Fri Dec 14, 2018 10:41 pm

OS Versions are Windows Server 2008, 2008 R2, and 2012.

When I ran the command from that server using an elevated command prompt there was no message and nothing happened.

User avatar
Cubert
Posts: 1115
Joined: Tue Dec 29, 2015 7:57 pm
Contact:

Re: Updating Powershell with PoSH

Post by Cubert » Mon Dec 17, 2018 3:51 pm

Really, ok lets run just this part..

wusa %windir%\ltsvc\Windows6.1-KB2819745.msu

Does anything get reported? Looking for a Microsoft error like version mismatch or update does not apply warnings.

rmcclure
Posts: 6
Joined: Tue Aug 21, 2018 5:13 pm

Re: Updating Powershell with PoSH

Post by rmcclure » Wed Dec 19, 2018 3:28 pm

Got an error that time.

Windows Update Standalone Installer

Installer encountered an error: 0x80096002

The certificate for the signer of the message is invalid or not found.

User avatar
Cubert
Posts: 1115
Joined: Tue Dec 29, 2015 7:57 pm
Contact:

Re: Updating Powershell with PoSH

Post by Cubert » Wed Dec 19, 2018 4:56 pm

Interesting..

Let me see if they have a new installer posted.

User avatar
Cubert
Posts: 1115
Joined: Tue Dec 29, 2015 7:57 pm
Contact:

Re: Updating Powershell with PoSH

Post by Cubert » Wed Dec 19, 2018 5:02 pm

Interesting..

Let me see if they (Microsoft) has a new installer posted.

rmcclure
Posts: 6
Joined: Tue Aug 21, 2018 5:13 pm

Re: Updating Powershell with PoSH

Post by rmcclure » Wed Jan 02, 2019 9:37 pm

Good Afternoon,

I was wondering if you had an update on this?

Thank you!

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests