SMS 2003 and ConfigMgr 2007, PowerShell, Scripting, Finance, Fitness and Fun

Shaun Cassells at MyITForum.com

Browse by Tags

Delete a successful Direct Member from an SMS 2003 / ConfigMgr 2007 collection based on a date in VB

May 28, 2008

In SMS 2003 and ConfigMgr (SCCM) 2007 you can create a Direct Member to a collection. This may or may not be the best option for you. We can debate that later. You have to be concerned about the number of Direct Memberships the SMS 2003 / ConfigMgr 2007 server must evaluate. The ColEval.log on the server could be overwhelmed if too many memberships are created and then the collection refreshed. Overwhelmed does not mean any errors, rather many tasks will be queued leaving you wondering why offers...  ... Read the full post or  be the first to comment. Filed under: , , , , ,

PowerShell: SMS 2003 / ConfigMgr 2007 scripting

May 20, 2008

I decided it was about time I learned more PowerShell and SMS 2003 / SCCM 2007 scripting. I hope you enjoy this series, as I fail, experiment, and learn nuances of the PowerShell language. There seem to be a lot of information about 3 ComObjects for SMS 2003 / SCCM 2007 on the internet. Those are: SMS Client Actions Microsoft.SMS.Client Control Panel Client Actions cpapplet.cpappletmgr Software Distribution UIResource.UIResourceMgr How do I use a COM Object in PowerShell? Create an Object Declare...  ... Read the full post or  be the first to comment. Filed under: , , , , ,

How to stop an errant Advertisement in SMS 2003 / SCCM 2007

May 14, 2008

Scenario : An advertisement went out for a package that is causing havoc. Let’s say, it is rebooting servers and workstations. How do you stop it NOW !?!?! With a Big Red Stop Button (BRSB). Below are 5 scenarios with varying speeds and success rates. Method 1 : Stop the IIS service or the SMS_OFFER_MANAGER service on all servers. Upside : Everything stops Downside : Everything stops including normal client communications or any other distribution Method 2 : Delete the source package files off the...  ... Read the full post or  the 4 comments. Filed under: , , , ,

Determining if a discovered resource is in Bounds and steps to make that eaiser.

January 02, 2008

This article details the methods necessary to make roaming boundaries readable from the SMS table by creating a View, a function to convert an IP address to Decimal, and a code snippet to identify machines boundaries based machine name from SMS. Below is an easy way to read Site Boundaries; SQL View Definition: USE [ENTER DATABASE NAME HERE] GO /****** Object: View [dbo].[v_SiteRoamingBoundary_IPRange_Readable] Script Date: 01/02/2008 11:56:44 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON...  ... Read the full post or  be the first to comment. Filed under: ,

SMS_Def.MOF Softgrid edit - doesn't really get the job done

November 28, 2007

I was playing around with the great Mof hack by Cristiano from the article “Inventorying Microsoft SoftGrid Streamed Applications” found here: http://blogs.msdn.com/crisag/archive/2006/12/14/inventorying-microsoft-softgrid-streamed-applications.aspx Two notes : 1) there is a typo on this line “string OriginalDescriptionURL” needs a semicolon at the end ‘;’ 2) This will return all the possible to execute SoftGrid applications on a client. It does not tell you which ones are installed nor when they...  ... Read the full post or  be the first to comment. Filed under: , , , ,

Remote Desktop Users - SMX DataSift Addition - updating the SMS_Def.Mof to include users who have rights to log on remotely

November 28, 2007

I have been using the SMSExpert.com DataShift modifications for SMS 2003 SP2. A recent request came in to also gather the ‘Remote Desktop Users’ group. Below are the script and the MOF edit. Enjoy ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''...  ... Read the full post or  the first comment. Filed under: , , ,

SMS 2003 Script to Delete Collections based on Criteria

August 08, 2007

The following VBS script is used to delete collections. Script Required Inputs SMS Server Name SMS Site Code (of the server) Collection Search String Optional Commit of a capital “Y” The 4 th parameter is a commit of collection deletion. This means you can run the script to see all the collections that match your search string BEFORE you delete. Example Usage Cscript DelCollection.vbs SMSServer XYZ “Microsoft Visio 2007 - %” · Used to display all collections matching string Cscript DelCollection...  ... Read the full post or  the first comment. Filed under: , ,

SMS 2003 Reroot orphaned collections

June 01, 2007

'Author Shaun Cassells 'Shaun dot cassells at gmail dot com '3-19-2007 ' This script creates an association in v_CollectToSubCollect table. ' Inputs required ' Server Name ' Server Site Code ' Parent Collection Name ' Collections to query to be made sub collections of parent ' Go or no go. Should be value of "Y" if you want it to go 'For command line input if Wscript.Arguments.Count = "4" Then SMSServer = WScript.Arguments(0) SiteCode...  ... Read the full post or  be the first to comment. Filed under:

How to Determine SMS Thread Responsible for High CPU Use [sms] Q234508

May 14, 2007

This article has been retired off of Microsoft’s KB archive. This technique works perfectly for SMS 2003 and several other server applications. I thought posting it here again would be more useful and searchable. SMS: How to Determine SMS Thread Responsible for High CPU Use [sms] ID: Q234508 CREATED: 03-JUN-1999 MODIFIED: 30-JUN-2000 winnt:2.0 winnt PUBLIC | kbSMS200 ====================================================================== SUMMARY ===================================================...  ... Read the full post or  be the first to comment. Filed under:

SMS 2003 Scripting - Set Security Premissions function in VB

April 05, 2007

The following VB function block will set security premissions to an object of specified type in SMS. Note: through trial and error, i have 10 types of ObjKeys. SMS SDK 3.1 doesn't list them all. Have fun and watch for line wrap! Function SetSecurityPremissions(IntKey As String, ObjKey As Integer, UserName As String) As String 'IntKey = ID of object - e.g. packageID 'objkey = Type of Object 'username = Group to grant access to 'InstancePerms = Permissions to grant 'MSDN:SMS_UserInstancePermissions...  ... Read the full post or  be the first to comment. Filed under:

Sending a HTTP post from a command prompt (scripted)

March 02, 2007

Below is a quick script to send HTTP information to a website. This is extremly powerful for submitting information from a workstation to a SQL database. How does it get to a database from an HTTP post? create an *.asp page on an webserver have the *.asp page take command line parameters and pass them to a SQL insert string Why do SQL on server? Well it keeps the password and / or security rights on your website and not distributed to clients '====================================================...  ... Read the full post or  the first comment. Filed under:

-2147217407 error or 80041001 how to avoid programmatically

February 07, 2007

If you have done any scripting or programming for WMI you have inevitably run into error 2147217407 or -2147217407 or 80041001 What is this error? Well it is ExecASynchQuery Failure. Umm okay what does that mean? It means the query took long enough that it timed out. What does that mean? That either you are referencing an object that was just created (and isn't done being created) or the server was to busy (might want to consider opening more WMI connections) or that your search isn't specific enough...  ... Read the full post or  be the first to comment. Filed under:

Modification of SMSAutomation DLL from the SMS 2003 SDK 3.1 to prevent duplicate items with the same name

February 07, 2007

I have gotten back into scripting and programming for SMS again. This time in C# Programmatic Problem : SMS has a restriction that requires a unique name in the MMC. However, programmatically you can create as many items as you want because they are based on a unique instance ID (eg. CollectionID) The following Code Fragment is from the Collections.cs. Modifying the Constructor. I put a try catch block in to see if the exact name already exists. If it does exist, return nothing. If it doesn't continue...  ... Read the full post or  be the first to comment. Filed under:

Trickle Feed script update - Direct Memberships and Moves to reduce repeat instances

November 14, 2006

Their is another script out in the Code Repository of MyITForum.com. 10762Tricle_Feed.zip The orginal script uses queries and grabs a random (possibly repeating) number of clients from a source collection. Then adds that query to the destination collection. This works well when you do large number of machines... but does not work so well on smaller groups. My version attached and below: Does Direct Memberships Outputs to a log to check whats going on Takes a Source Collection with PCs added (assumes...  ... Read the full post or  be the first to comment. Filed under: