Jump to content

Recommended Posts

  • Moderators
Posted (edited)

I am finally back at a customer location where I could work with Microsoft System Center Configuration Manager, and wanted to update the script from >this thread. This time around, rather than a full GUI it is simply a UDF, allowing the user to employ the functions however they would like. This has been tested on 2012 and 2012 R2; unfortunately I no longer have any customers with access to 2007.

Currently there are 11 public functions; will continue to update and provide examples as I get a chance. There is also an _SCCM_Constants.au3 that needs to be copied to the Includes directory.

Updated 10/14/2014: Added _SCCM_DeletePC function and example

Updated 04/12/2015: Added _SCCM_RefreshCollection function and example

_SCCM.au3

_SCCM_Constants.au3

Examples:

  Reveal hidden contents

Connect to the SCCM server and return an array of all collections for the site

Return an array of collections based on a given filter

Add a single machine to a collection

Remove a single machine from a collection

Remove all machines from a collection

Return an array of all collections for a specified PC

Return an array of all PCs in a given collection

Trigger the specified Update task on a client

Restart the SMS Agent Host Service on the specified PC

Repair the Configuration Manager Client on the specified PC

Open the SCCM logs directory on the specified PC

Delete an asset from the SCCM database

Search the SCCM database for conflicting records and merge

Connect to the the SCCM database and refresh either a single collection or all collections.

 

 

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

  • 2 weeks later...
  • 5 months later...
  • 3 months later...
Posted

Wonder if you have suggestion.  Looking for an Autoit script to initiate the same process the SCCM 2012 R2 client would use to select an appropriate distribution point server name, based on current location, boundaries, etc., to pull a package.

We are trying to implement MS Office 365 Click-to-run, and let the updates process run against the 'appropriate' SCCM DP for the update media... we want to select the same DP that SCCM would use for the PC in its current boundary.

I hope that makes sense.

  • Moderators
Posted

While not a part of the UDF, you could always use the current management point on each client, which will be up to date as of the last heartbeat check-in. Something like this will get you the name of the DP

$oConfigMgr = ObjCreate("Microsoft.SMS.Client")
    If Not @error Then MsgBox(0, "", $oConfigMgr.GetCurrentManagementPoint)

 

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

  • 1 year later...
Posted

Is this still being developed? I'm working on making a tool that allows my help desk to search for existing devices via Name, MAC address, or GUID and delete them from SCCM.

"There are only 10 types of people in the world: Those who understand binary, and those who don't"

  • Moderators
Posted

@tcox8 unfortunately I have not been supporting any customers that use SCCM as of late, so have not updated this recently. In truth it needs a full re-write, in which I would probably simply wrap the PowerShell commands.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Posted

I'm familiar with all the powershell command but was in need of an .exe. I'll try to figure out how to wrap the powershell commands in autoit. Thanks! @JLogan3o13

"There are only 10 types of people in the world: Those who understand binary, and those who don't"

  • Moderators
Posted

There are a number of posts on the forum regarding wrapping an AutoIt GUI around powershell; a quick google or forum search should get you well along your way.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...