Tuesday, June 12, 2012

Create ConfigMgr 2007 Console Extensions


Create ConfigMgr 2007 Console Extensions

Scope

Extend the console with custom VBS scripts

Process

Create a new XML to call your custom tools with the correct SUB

XML File Contents

<ActionDescription Class="Group" DisplayName="<Right Click Menu Name>" MnemonicDisplayName="<Right Click Menu Name>" Description="<Status Bar Description>" SqmDataPoint="53">
<ActionGroups>
<ActionDescription Class="Executable" DisplayName="<Right Click Menu Action Name>" MnemonicDisplayName="<Right Click Menu Action Name>" Description="<Status Bar Description>">
<Executable>
<FilePath>wscript.exe</FilePath>
<Parameters> "<SCRIPT File LOCATION>" ##SUB:Name##</Parameters>
</Executable>
</ActionDescription>
</ActionGroups>
</ActionDescription>


SUBs

**(Full list found in the adminconsole.xml where the ConfigMgr Console is installed)
##SUB:__Server##
##SUB:__Namespace##
##SUB:Name##
##SUB:PackageID##
##SUB:ProgramName##
##SUB:SiteCode##
##SUB:SiteName##
##SUB:NetworkOSPath##
##SUB:AddressType##
##SUB:Order##
##SUB:value##
##SUB:ItemName##

Copy XML to Console Action Folder

SCCM Client Action Folders Location
<SCCM Installation Location>AdminUI\XMLStorage\Extensions\Actions\
                ***GUID Folders may need to be created
Common SCCM Client Action GUID Folders
·         Single Machine Actions: 7ba8bf44-2344-4035-bdb4-16630291dcf6
·         Root-level collections: fa922e1a-6add-477f-b70e-9a164f3b11a2
·         Sub Collections: dbb315c3-1d8b-4e6a-a7b1-db8246890f59
·         Collection instance: f91c082d-bb83-44db-8ab9-907607b1dc44
·         Programs: de41d5d8-3845-4e67-9657-0121f06f5e27
·         Advertisements: a1ad0705-ce2d-4981-96f5-8f0faad47396
·         Site Systems:  49696c48-9c3a-4d4a-bb38-473394700d43

Additional GUIDs can be found using adminconsole.xml where the ConfigMgr Console is installed or GUID.zip found on myITforum.com
·         Extract GUID.Zip to C:\GUID.
·         Copy all the subfolders located in C:\GUID\ to <SCCM Installation    Location>AdminUI\XMLStorage\Extensions\Actions\
·         Restart your SCCM Console.

Update VBS to accept an argument

There are many arguments that can be passed from the ConfigMgr console to your scripts.  The computer name argument is ##SUB:Name## found in the XML file example above.  This will pass the computer name as an argument to the vbscript.  You will need to add a few lines to your vbscript for this to work.
At the top of your script type or paste
Set args = WScript.Arguments
If you are running a script against a computer name then where you specify the computername like strComputerName = ‘.’ You will need to make it strComputerName = args(0)
With those two edits to your vbscript the ConfigMgr Console should pass the computer name to the vbscript to run the expected actions.

References





No comments:

Post a Comment