Saturday, May 31, 2008

SMS / SCCM helpful forums

Here a few of the places I haunt to give or received information

SCCM Forum

SMS Newgroups


Vbscript behavior

Wscript Method wscript x.vbs

Cscript Method cscript x.vbs

Do you have right click tools that run in a command (DOS) box. And you have an "Enter" key function so it will stay open so you can see the data.

There are 2 things you can do.
1. Run with a wscript xxx.vbs
This will force it to use the wscript method and data will be placed in a nice popup box
2. Set the default method for vbscript to wscript
wscript /H:WScript
A popup will tell you that the default is now wscript do the same with a cscript to change it back

This will make some of the right click tools that display information alot easier to read and gives it a more professional look.

Friday, May 30, 2008

SMS OU to Collection Tool

Edit: 12/2008 I have the tool on myITforum under the beta section SCCM OU Collection Creator - Matthew Hudson

Well I have a new tool that I might give to the community to test. I have finished but it is very rough. The basic idea came several years ago when I was creating our SMS collections. We have a collection called Departments. In it I have the different OU represent so I can do limits or deployments. The problem is that we have many departments so I only make a collection as needed. The new tool will query your AD via LDAP. It will look to your SCCM control file for the correct ldap path. It will then give you the structure for you to click on for import. Once you have all your OUS you click import and about 4 to 6 seconds later you have your entire AD struction in SCCM with the queries written for it as well. I have a few bugs to work out but I hope to give it to some people for testing. I think it would be a good tool. Granted most people might only use it 1 or 2 times.

When it gets posted it will most likely be via MyITforum.

SMS Exam

Well after dragging my feet I finally took the SMS Exam 70-089. I passed with a 936. Now on to 70-401, SCCM exam.

Tuesday, May 20, 2008

Internet Based Client setup

Did you already deploy the client to your machines? Did you want to setup some laptops or computers with Internet Based management. Use this vbscript to push the change to the necessary computers:

On Error Resume Next

Dim newInternetBasedManagementPointFQDN
Dim client

newInternetBasedManagementPointFQDN = ""

set client = CreateObject ("Microsoft.SMS.Client")
client.SetInternetManagementPointFQDN newInternetBasedManagementPointFQDN

' Clear variables.
Set client = Nothing
Set internetBasedManagementPointFQDN = Nothing

Tuesday, May 13, 2008

Collections with Maintenance Windows

Here is an update to my previous vbscript file that had collection listings.
This vbscript can be run from the console of SCCM. It will tell you what user a collection is in, what collection a computer is in. You also have the option of seeing if a maintenance window is set to the collection. This is my first version of this. Please let me know any changes

'Matthew Hudson
'There is no warranty, run code at your own risk

''' sytanx: Application ResourceID Option
' option= blank No tag
' option=1 Collections with Maintenance windows will have a *
' option=2 Collections with Maintenance windows will have a description next to them

on error resume next
Dim CollectionArray(100)
Dim MainWindowArray(100)

Set objArgs = WScript.Arguments
if (objArgs.count > 1) then
Mainoption = wscript.arguments.item(1)
end if
ResourceID = wscript.arguments.item(0)

Set Shell = CreateObject("Wscript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set SWbemLocator=CreateObject("WbemScripting.SWbemLocator")
set SWbemServices = SWbemLocator.ConnectServer("SERVER","root\SMS\site_XXXX")
Set connection= swbemServices
strQuery = "select * from SMS_CollectionMember_a where ResourceID='"+ ResourceID +"'"
Set Collections = SWbemServices.ExecQuery(strQuery)

'''''''''''''''''' move through the collections
for each Collection in Collections
set Collectionfound=SWbemServices.Get("SMS_Collection='" & Collection.CollectionID & "'" )
'''''' see if there is a maintenance window
Set collectionSettingsInstance = SWbemServices.Get("SMS_CollectionSettings.CollectionID='" & Collection.CollectionID &"'" )
Set allCollectionSettings = connection.ExecQuery("Select * From SMS_CollectionSettings Where CollectionID = '" & Collection.CollectionID & "'")
If allCollectionSettings.Count > 0 then
MaintenanceWindowArray = collectionSettingsInstance.ServiceWindows
'wscript.echo Collectionfound.Name & len(MaintenanceWindowArray(0).Name)
if Mainoption="2" then
end if
if Mainoption="1" then
end if
end if

'Sort Collection list
for i = count - 2 To 0 Step -1
for j= 0 to i
if CollectionArray(j)>CollectionArray(j+1) then
end if
''' print out the collection listing
For NC = 0 to count-1
WhatCollections= WhatCollections & CollectionArray(NC) & " " & MainWindowArray(NC) & VbCrLf

Wscript.echo WhatCollections


<ActionDescription Class="Group" DisplayName="MCNS" MnemonicDisplayName="MCNS" Description="MCNS Tools" SqmDataPoint="100">

<ActionDescription Class="Executable" DisplayName="Collection Listing" MnemonicDisplayName="Collection Listing" Description="Display machine Collection membership">
<FilePath>C:\Program Files\MCNS\collections\compmain.vbs</FilePath>
<Parameters>##SUB:ResourceID## 1</Parameters>

If the tool vbscript just runs a black box and disappears then check out this link