locked
Powershell Command to get computer status in a target group RRS feed

  • Question

  • Hi , I am trying to build a powershell script that will find out the computer status in a target group as in how many are ok, with error, or needing updates etc.

    so far i am able to select a target group and get the total computer count in it but I am not able to get the count of computer that need updates and other status.

    Any help will be appreciated.

    Tuesday, October 21, 2014 9:40 AM

Answers

  • Hi Lawrence,

    I was creating a powershell script to pass on the info to the inhouse nagios server to display the wsus status on the monitoring tool.

    Gotcha!

    This can also be done with the PUBLIC_VIEWS and SQL.

    As for the PowerShell, a note about the relationships may help.

    Approvals are assigned to a Group.

    • A Group contains Members (read: Computers)
    • A Computer has a status count for updates (NotApplicable, Needed, Installed)
    • An Update has a status count for computers (NotApplicable, Needed, Installed)

    So, to get a status report by target group requires navigating through a couple of pathways.

    • You can query a target group for approved updates, and then query each of those updates for status counts of computers. This will give you the number of computers that need each update.
    • You can query a target group for members, and then query each of those members for status counts of updates. This will give you the number of updates needed by each computer.


    Lawrence Garvin, M.S., MCSA, MCITP:EA, MCDBA
    SolarWinds Head Geek
    Microsoft MVP - Software Packaging, Deployment & Servicing (2005-2014)
    My MVP Profile: http://mvp.microsoft.com/en-us/mvp/Lawrence%20R%20Garvin-32101
    http://www.solarwinds.com/gotmicrosoft
    The views expressed on this post are mine and do not necessarily reflect the views of SolarWinds.

    • Marked as answer by anshul somani Monday, October 27, 2014 9:42 AM
    Friday, October 24, 2014 10:34 PM
  • Hi anshul,

    Please try to use the Get-WsusComputer command.

    The Get-WsusComputer cmdlet retrieves one or more computers based on the specified filtering criteria such as operating system, computer name, update installation status, last reported status time, and etcetera.

    For detailed information about Get-WsusComputer, please refer to the link below,

    http://technet.microsoft.com/en-us/library/hh826156.aspx

    Best Regards.



    Steven Lee

    TechNet Community Support

    • Marked as answer by anshul somani Thursday, October 23, 2014 8:55 AM
    Wednesday, October 22, 2014 7:51 AM

All replies

  • Hi anshul,

    Please try to use the Get-WsusComputer command.

    The Get-WsusComputer cmdlet retrieves one or more computers based on the specified filtering criteria such as operating system, computer name, update installation status, last reported status time, and etcetera.

    For detailed information about Get-WsusComputer, please refer to the link below,

    http://technet.microsoft.com/en-us/library/hh826156.aspx

    Best Regards.



    Steven Lee

    TechNet Community Support

    • Marked as answer by anshul somani Thursday, October 23, 2014 8:55 AM
    Wednesday, October 22, 2014 7:51 AM
  • Hi , I am trying to build a powershell script that will find out the computer status in a target group as in how many are ok, with error, or needing updates etc.

    May I ask... why is merely reading the console insufficient for this task?

    Lawrence Garvin, M.S., MCSA, MCITP:EA, MCDBA
    SolarWinds Head Geek
    Microsoft MVP - Software Packaging, Deployment & Servicing (2005-2014)
    My MVP Profile: http://mvp.microsoft.com/en-us/mvp/Lawrence%20R%20Garvin-32101
    http://www.solarwinds.com/gotmicrosoft
    The views expressed on this post are mine and do not necessarily reflect the views of SolarWinds.

    Thursday, October 23, 2014 4:42 AM
  • Hi Lawrence,

    I was creating a powershell script to pass on the info to the inhouse nagios server to display the wsus status on the monitoring tool.

    Thursday, October 23, 2014 8:56 AM
  • Hi Lawrence,

    I was creating a powershell script to pass on the info to the inhouse nagios server to display the wsus status on the monitoring tool.

    Gotcha!

    This can also be done with the PUBLIC_VIEWS and SQL.

    As for the PowerShell, a note about the relationships may help.

    Approvals are assigned to a Group.

    • A Group contains Members (read: Computers)
    • A Computer has a status count for updates (NotApplicable, Needed, Installed)
    • An Update has a status count for computers (NotApplicable, Needed, Installed)

    So, to get a status report by target group requires navigating through a couple of pathways.

    • You can query a target group for approved updates, and then query each of those updates for status counts of computers. This will give you the number of computers that need each update.
    • You can query a target group for members, and then query each of those members for status counts of updates. This will give you the number of updates needed by each computer.


    Lawrence Garvin, M.S., MCSA, MCITP:EA, MCDBA
    SolarWinds Head Geek
    Microsoft MVP - Software Packaging, Deployment & Servicing (2005-2014)
    My MVP Profile: http://mvp.microsoft.com/en-us/mvp/Lawrence%20R%20Garvin-32101
    http://www.solarwinds.com/gotmicrosoft
    The views expressed on this post are mine and do not necessarily reflect the views of SolarWinds.

    • Marked as answer by anshul somani Monday, October 27, 2014 9:42 AM
    Friday, October 24, 2014 10:34 PM