locked
Powershell script for SCCM 2012 RRS feed

  • Question

  • Hi all,

    I'm not that good yet in scripting so perhaps someone here can help me out. I'm looking for a way to check which of the clients in a network have SCCM 2012 installed and which not. Besides that I want to know which SCCM clients work and which not out of the ones installed.

    I thought it would be easiest to check with a simple Powershell script, but like I said I could use some help with this.

    • Moved by Bill_Stewart Thursday, November 27, 2014 6:17 PM Move to more appropriate forum
    Thursday, November 27, 2014 9:47 AM

Answers

  • The entire task is not going to be an easy one ... you should query AD directly (instead of using the discovery methods as it might be possible that not all computers will be added to ConfigMgr (no name resolution, account disabled, etc)) and compare that to ConfigMgr.

    Torsten Meringer | http://www.mssccmfaq.de

    • Proposed as answer by Joyce L Friday, November 28, 2014 2:08 AM
    • Marked as answer by Joyce L Thursday, December 4, 2014 10:45 AM
    Thursday, November 27, 2014 9:28 PM

All replies

  • You should start by postingyour quesitons int eh SCCM forum.  THey will helpyou sort out howto use SCCM.  Much of what you need are available through SCCM. That is what it is for.


    ¯\_(ツ)_/¯

    Thursday, November 27, 2014 12:07 PM
  • Jrv is right - everything you are asking for can be seen in the Configuration Manager Console under Devices in the Assets and Compliance tab or by running a report. Scripting should not be necessary.

    • Edited by Braham20 Thursday, November 27, 2014 1:25 PM
    Thursday, November 27, 2014 1:23 PM
  • Creating some collections might help with this, here are a few:

    Devices with SCCM Client but showing as Inactive (more than 7 days with no activity)

    select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_CH_ClientSummary on SMS_G_System_CH_ClientSummary.ResourceId = SMS_R_System.ResourceId where SMS_G_System_CH_ClientSummary.ClientActiveStatus = 0

    Devices with no SCCM Client.

    select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System where (SMS_R_System.Client is null or SMS_R_System.Client = 0) and SMS_R_System.Name != 'Unknown'

    If you were to Create a 3rd collection and exclude the above 2 collections that would leave you all healthy clients.

    It's also worth installing the now micro right click tools.

    You can get a very quick feel for how many devices are turned on in a collection.

    http://www.nowmicro.com/rct/


    Thursday, November 27, 2014 8:43 PM
  • Hi,

    on windows clients you can try get their ccm clientid from wmi.

    (gwmi -computername <computername> -namespace root\ccm -class ccm_client).ClientID

    It fails on clients without ccm client installed because namespace does not exists. Use try-catch.

    Hope this help.

    Karel

    Thursday, November 27, 2014 9:02 PM
  • Hi Marki, Obviously what the guys above have said is true, provided you have the network or AD discovery methods setup to discover what is on your network so everything has a resource record created in the SCCM console. There is also the client health status views under the monitoring tab which show you the percentage of clients that are active and also the health of all systems that have the client installed and are reporting any errors when running the daily ccmeval process.
    Thursday, November 27, 2014 9:12 PM
  • The entire task is not going to be an easy one ... you should query AD directly (instead of using the discovery methods as it might be possible that not all computers will be added to ConfigMgr (no name resolution, account disabled, etc)) and compare that to ConfigMgr.

    Torsten Meringer | http://www.mssccmfaq.de

    • Proposed as answer by Joyce L Friday, November 28, 2014 2:08 AM
    • Marked as answer by Joyce L Thursday, December 4, 2014 10:45 AM
    Thursday, November 27, 2014 9:28 PM