Jump to content
taurus905

Remotely determine if Configuration Manager is installed

Recommended Posts

taurus905

When Configuration Manager is installed on a Windows 7 pc, it shows in Control Panel.

I'd like to use WMI to query remote PCs to see if Configuration Manager is installed.

Or, is there another way to accomplish the same goal?

Thank you in advance.

taurus905


"Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs

Share this post


Link to post
Share on other sites
taurus905

Thanks for the suggestion, Bert. But I didn't have any luck finding anything along those lines.

However, I did find this:

http://blogs.technet.com/b/configmgrdogs/archive/2014/09/05/wmi-powershell-and-the-configuration-manager-client.aspx

(Invoke-WMIMethod -ComputerName $remoteMachine –Namespace root\ccm –Class SMS_Client –Name GetAssignedSite).sSiteCode

Now I will just turn the powershell command into an AutoIt script with a list of my 800+ PCs. Where the command fails, Configuration Manager is not installed on that machine.


"Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs

Share this post


Link to post
Share on other sites
Jewtus

This function is native to windows, but its a little slow in my experience.

https://msdn.microsoft.com/en-us/library/bb742610.aspx

 

Wmic does what you are talking about without needing to enable powershell scripts (which if you don't have admin access on the machine, you won't be able to enable)

Share this post


Link to post
Share on other sites
JLogan3o13

Why not just use the SCCM db itself to query for which machines have an active heartbeat? You can use the SCCM UDF in my signature to do it a couple of different ways:

 

return all good heartbeats:

#include <_SCCM.au3>
#include <Array.au3>

Local $sServer = "afic-sccm"
Local $sCode = "P01"

_SCCM_Connect($sServer, $sCode)
    If Not @error Then $myReturn = _SCCM_Search("")
    If IsArray($myReturn) Then _ArrayDisplay($myReturn)

Search just for one machine:

#include <_SCCM.au3>
#include <Array.au3>

Local $sServer = "afic-sccm"
Local $sCode = "P01"

_SCCM_Connect($sServer, $sCode)
    If Not @error Then $myReturn = _SCCM_Search("ThatPeskyPC")
        ConsoleWrite(((IsArray($myReturn)) ? "Asset not found in database" : "Asset alive and responding to heartbeat") & @CRLF)

 


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
taurus905

This function is native to windows, but its a little slow in my experience.

https://msdn.microsoft.com/en-us/library/bb742610.aspx

 

Wmic does what you are talking about without needing to enable powershell scripts (which if you don't have admin access on the machine, you won't be able to enable)

​Thank you for the link, Jewtus.

It will come in handy in the future. Luckily, I do have admin access to all of our PCs.


"Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs

Share this post


Link to post
Share on other sites
taurus905

Why not just use the SCCM db itself to query for which machines have an active heartbeat? You can use the SCCM UDF in my signature to do it a couple of different ways:

 

return all good heartbeats:

#include <_SCCM.au3>
#include <Array.au3>

Local $sServer = "afic-sccm"
Local $sCode = "P01"

_SCCM_Connect($sServer, $sCode)
    If Not @error Then $myReturn = _SCCM_Search("")
    If IsArray($myReturn) Then _ArrayDisplay($myReturn)

Search just for one machine:

#include <_SCCM.au3>
#include <Array.au3>

Local $sServer = "afic-sccm"
Local $sCode = "P01"

_SCCM_Connect($sServer, $sCode)
    If Not @error Then $myReturn = _SCCM_Search("ThatPeskyPC")
        ConsoleWrite(((IsArray($myReturn)) ? "Asset not found in database" : "Asset alive and responding to heartbeat") & @CRLF)

 

​Hello JLogan3o13,

Great UDF!

This will save me so much time.

Thank you for making it available to all of the AutoIt community.

taurus905


"Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×