Update pc's with Powershell 2.0

Hi,

I'd need to trigger an update of Powershell to those pc's with Powershell V2.0.
What query would I need?

May 21st, 2015 5:22am

Are you asking for a way to create a collection that contains computers where Powershell 2.0 is installed?
Free Windows Admin Tool Kit Click here and download it now
May 21st, 2015 5:33am

Yes indeed.
May 21st, 2015 5:35am

Hi,

You can do it by using Compliance Settings:

First create an application installing new version of Powershell.

Then create a Configuration Item with the following Powershell script as discovery script:

Write-Output $PSVersionTable.PSVersion.Major

and a compliance rule as the following screenshot :

 

  • Include this configuration item in a baseline and deploy the baseline to your computers.
  • Finally link the Non-Compliant Collection to the new PowerShell Version installation

As a result, computer with older version of Powershell will be added by SCCM to a non-compliance collection on which Powershell V2 isntallation is deployed.

Reg

May 21st, 2015 6:42am

Thanks! Looks good indeed.

I'm trying now with a collection which has 2 pc's: one with PS2 and one with PS 3 doesn't work yet. Data type script is integer, right?

Free Windows Admin Tool Kit Click here and download it now
May 21st, 2015 8:05am

Can't make this work for now though I'm really sure I have Powershell V2 AND V3 pc's in the collection that I point it to.

Then I wonder if this is the correct setup. This is an overload (running the powershell command to every system) compared to just collect the powershell.exe in the client (as mentioned here: https://social.technet.microsoft.com/Forums/en-US/dea8851a-78b5-4682-966b-2f58bfdf222e/check-powershellexe-file-version?forum=configmanagergeneral)

See screenshot below for settings, will trigger inventory cycle and hope to get results soon then.

May 21st, 2015 8:41am

The script doesn't cause any load, it's just returning the value of PowerShell.

I am going to give it a go later, looks good and not done any compliance stuff yet. If you are not using software inventory for anything else have a read of this before you decided to go down that road.

http://be.enhansoft.com/post/2013/10/03/Slow-Software-Inventory-Cycle-in-SCCM-2012.aspx


Free Windows Admin Tool Kit Click here and download it now
May 21st, 2015 9:10am

Yes data is an integer.

Regards,

Rgis

May 21st, 2015 11:03am

The script doesn't cause any load, it's just returning the value of PowerShell.

I am going to give it a go later, looks good and not done any compliance stuff yet. If you are not using software inventory for anything else have a read of this before you decided to go down that road.

http://be.enhansoft.com/post/2013/10/03/Slow-Software-Inventory-Cycle-in-SCCM-2012.aspx


Free Windows Admin Tool Kit Click here and download it now
May 21st, 2015 1:07pm

Awesome,

Finally got around to trying this. Couldn't get it to work at first. Had to change my client settings to allow PowerShell execution, from then on it was all down hill.

May 23rd, 2015 1:47pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics