windows powershell version

Glenn Maxwell 10,731 Reputation points
2020-09-25T03:45:13.1+00:00

Hi All

i want to pull all my windows servers with their powershell shell version and OS version in my organization, how do i export this information from sccm, experts guide me on this

Microsoft Configuration Manager Application
Microsoft Configuration Manager Application
Microsoft Configuration Manager: An integrated solution for for managing large groups of personal computers and servers.Application: A computer program designed to carry out a specific task other than one relating to the operation of the computer itself, typically to be used by end users.
467 questions
Microsoft Configuration Manager
0 comments No comments
{count} votes

Accepted answer
  1. Fiona Yan-MSFT 2,311 Reputation points
    2020-09-25T07:06:26.857+00:00

    @Glenn Maxwell

    1.For querying the power shell version, please refer to this helpful guide:
    powershell-inventory-reports
    Note:This article is non-official articles just for your reference.

    2.For querying the OS version,Please refer to this link:
    Get-OS-Info-from-SCCM

    3.If the OS query was too old for us, maybe we could use sql query to have a try. I have use this query in my environment and it works.
    28345-sql-query-os-versions.png
    Here is the query code below:
    select Distinct
    v_R_System.Name0,
    v_GS_NETWORK_ADAPTER_CONFIGURATION.IPAddress0,
    v_GS_NETWORK_ADAPTER_CONFIGURATION.DNSHostName0,
    v_GS_NETWORK_ADAPTER_CONFIGURATION.DNSDomain0,
    v_GS_OPERATING_SYSTEM.Caption0 as 'Operating System',
    v_GS_OPERATING_SYSTEM.CSDVersion0 as 'Service Pack',
    dbo.v_FullCollectionMembership.SiteCode,
    CASE
    WHEN dbo.v_FullCollectionMembership.SiteCode LIKE 'A%' THEN 'India'
    WHEN dbo.v_FullCollectionMembership.SiteCode LIKE 'O%' THEN 'UK'
    ELSE 'Unidentified' END AS 'Country'
    from v_R_System
    INNER JOIN dbo.v_FullCollectionMembership ON dbo.v_R_System.ResourceID = dbo.v_FullCollectionMembership.ResourceID
    Inner Join v_GS_OPERATING_SYSTEM ON v_GS_OPERATING_SYSTEM.Resourceid=v_R_System.Resourceid
    Inner join v_GS_NETWORK_ADAPTER_CONFIGURATION ON v_GS_NETWORK_ADAPTER_CONFIGURATION.ResourceID=v_R_System.ResourceID
    where (dbo.v_FullCollectionMembership.SiteCode != 'NULL') and (Operating_System_Name_and0 != 'NULL')

    Hope this could help you.


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Glenn Maxwell 10,731 Reputation points
    2020-09-28T13:35:29.977+00:00

    thanks but not sure how to pull windows powershell version,
    the query to be used shud be something like %windir%\System32\WindowsPowerShell\v

    0 comments No comments

  2. Fiona Yan-MSFT 2,311 Reputation points
    2020-09-29T09:32:08.417+00:00

    @Glenn Maxwell

    Maybe we could use the SCCM to deploy the power shell script to list some information that we want.
    The script was shown as below:
    $ostype = (Get-WMIObject win32_operatingsystem).caption
    $temp = "{0,-15}{1,-45}{2,-15}" -f "Computername","OS Version","PowerShell Version" | out-file -filepath "shared folder path.txt" -append
    if ($ostype -match "server")
    {$temp= "{0,-15}{1,-45}{2,-15}" -f $env:COMPUTERNAME,$ostype,$PSVersionTable.PSVersion | out-file -filepath "shared folder path.txt" -append}
    29257-os-version.png
    Here is a helpful guide to deploy the script:
    https://systemcenterdudes.com/sccm-deploy-powershell-script/
    Note: This is non-official article just for your reference.


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  3. dekac 1 Reputation point
    2020-09-30T14:46:34.78+00:00

    Use CMPivot and run it against a collection of servers in the question. Something like:

    Registry('hklm:\SOFTWARE\Microsoft\Powershell\3\PowershellEngine') | where Property == 'RuntimeVersion'

    29319-p1.png

    0 comments No comments