There are several different ways to connect to an SMS site server using Vbs. The two most common examples are shown below. The first one uses an input box to prompt you to enter the site server name and the site code. The final script hard codes the variables and all you need to do is specify the site server and site code.
By Input Box: Prompt
strSiteServer = InputBox("Site Server Name")
strSiteCode = InputBox("Site Code")
Set objSWbemServices = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" _
& strSiteServer & "\root\sms\site_" & strSiteCode)
If Err.Number <> 0 Then
Wscript.Echo "The Connection Failed"
Else
Wscript.Echo "Connection Established"
End If
Wscript.Quit
Hard Coded:
strSiteServer = "Site_Server"
strSiteCode = "Site_Code"
My wife of nearly 20 years sent this to me by mistake via E-Mail the other day. Since I do not need to take any of these classes I am forwarding the class schedule on. Those of you that can benefit from any of these classes please take advantage of them. Don.
Registration must be completed by Monday, November 28, 2006 as classes begin Monday, September 12, 2006
Note: Due to the complexity and difficulty level of their contents, class sizes will be limited to 6 participants maximum.
How To Fill Up The Ice Cube Trays
Step By Step With A Slide Presentation: Meets 4 weeks, Monday and Wednesday for 2 hours beginning at 7:00 PM.
The Toilet Paper Roll - Does It Change Itself?
Round Table Discussion: Meets 2 weeks, Saturday 12:00 for 2 hours.
Is It Possible To Urinate Using the Technique of Lifting the Seat and
Avoiding the Floor, Walls and Nearby Bathtub?
Group Practice: Meets 4 weeks, Saturday 10:00 PM for 2 hours.
Fundamental Differences Between The Laundry Hamper and The Floor
Pictures and Explanatory Graphics: Meets Saturday at 2:00 PM for 3 weeks.
After Dinner Dishes - Can They Levitate and Fly Into The Kitchen Sink?
Examples on Video: Meets 4 weeks, Tuesday and Thursday for 2 hours beginning at 7:00 PM.
Loss Of Identity - Losing The Remote To Your Significant Other.
Help Line Support and Support Groups: Meets 4 Weeks, Friday and Sunday 7:00 PM.
Learning How To Find Things - Starting With Looking In The Right Places
And Not Turning The House Upside Down While Screaming.
Open Forum: Monday at 8:00 PM, 2 hours.
Health Watch - Bringing Her Flowers Is Not Harmful To Your Health.
Graphics and Audio Tapes: Three nights; Monday, Wednesday, Friday at 7:00 PM for 2 hours.
Real Men Ask For Directions When Lost
Real Life Testimonials: Tuesday at 6:00 PM Location to be determined.
Is It Genetically Impossible To Sit Quietly While She Parallel Parks?
Driving Simulations: 4 weeks, Saturday noon, 2 hours.
Learning to Live - Basic Differences Between Mother and Wife.
Online Classes and role-playing: Tuesday at 7:00 PM, location to be determined.
How to be the Ideal Shopping Companion
Relaxation Exercises, Meditation and Breathing Techniques: Meets 4 weeks, Tuesday and Thursday for 2 hours ! Beginning at 7:00 PM.
How to Fight Cerebral Atrophy - Remembering Birthdays, Anniversaries and
Other Important Dates and Calling When You're Going To Be Late.
Cerebral Shock Therapy Sessions and Full Lobotomies Offered: Three nights; Monday, Wednesday, Friday at 7:00 PM for 2 hours.
The Stove/Oven - What It Is and How It Is Used.
Live Demonstration: Tuesday at 6:00 PM, location to be determined.
Upon completion of any of the above courses, diplomas will be issued to the survivors.
When troubleshooting either SMS Server or client issues, SQL server issues or Windows issues in general it is always a good idea to have a list of error codes handy and at your disposal for a quick reference.
Here is a complied list by error code numbers in numeric order of Microsoft operating system error codes in an Excel spreadsheet that you can download to have the list available when need more information about a particular error code.
Download The Operating System Error Codes Excel Spreadsheet
Download Zip File
This Vbs script will prompt you to enter a new Registered Owner name and \ or new Registered Organization name for your Windows XP or Windows 2003 server operating system.
Note: If no value is added to either of the input box prompts no changes will be made.
Vbs Script:
strRegisteredOwner = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\RegisteredOwner"
strRegisteredOrganization = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\RegisteredOrganization"
strType = "REG_SZ"
strRegisteredOwnerValue = InputBox("Enter New Registered Owner Value")
If strRegisteredOwnerValue <> "" Then
Set WSHShell = WScript.CreateObject("WScript.Shell")
WSHShell.RegWrite strRegisteredOwner, strRegisteredOwnerValue, strType
Wscript.Echo "The Registered Owner Is: " & strRegisteredOwnerValue
Wscript.Echo "The Registered Owner Has Not Changed"
strRegisteredOrganizationValue = InputBox("Enter New Registered Organization Value")
If strRegisteredOrganizationValue <> "" Then
WSHShell.RegWrite strRegisteredOrganization, strRegisteredOrganizationValue, strType
Wscript.Echo "The Registered Organization Is: " & strRegisteredOrganizationValue
Wscript.Echo "The Registered Organization Has Not Changed"
This script will take a machine name from the input box and force the SMS client repair cycle on the remote machine based on Michael Niehaus's article below:
VBS Script:
strComputer = InputBox("Enter Client Machine To Repair")
Set SmsClient = GetObject("winmgmts://" & strComputer & "/Root/Ccm:SMS_Client")
SmsClient.RepairClient
WScript.Echo "Repair Is In Progress For " & UCase(strComputer)
Repair the SMS client
http://www.myitforum.com/articles/8/view.asp?id=6506
To use the SMS SQL database to find those machines that are running a specified service you must remember that the SMS inventory you are requesting is only as good as the last time the inventory was run on the client machine. This means simply that the service was running when the inventory was obtained however the service may have been terminated moments after the inventory was collected.
You must also specify in your query that you only want those machines with the specified service listed AND have the service started state of 1 (On).
The example below uses the FTP Publishing service and can be changed as needed. If you want to use the service name rather than the service display name change the line that reads:
Where Services.DisplayName0 = 'FTP Publishing Service' to
Where Services. Name0 = ' MSFtpsvc'
SQL Query:
Select
SD.Name0 'Machine Name',
Services.Name0 'Service Name',
Services.DisplayName0 'Display Name',
Services.Started0
From System_Disc SD
Join Services_DATA Services on SD.ItemKey = Services.MachineID
Where Services.DisplayName0 = 'FTP Publishing Service'
And Services.Started0 = 1
Stuart Watret and company at Offshore-IT have released the SMS console Tools version 1.3 after a lively beta run. This version is a single MSI based executable and provides you with all your favorite SMS context menu tools and best of all they have chosen to provide them free of charge with documentation.
New tools include but are not limited to:
Download SMS Console Tools 1.3
http://offshore-it.co.uk/downloads/SMS_Console_AdditionsV1.3.zip
My favorite MP3 tag editor is a German developed application called Mp3tag. I have been using it for a year or two and it is one of those digital music utilities I can recommend as indispensable.
I like it because (1) it is free (Donations are accepted on their homepage), (2) it is very quick (3) it is easy to use and (4) it is customizable.
It has the ability to rename one or hundreds of music files based on their tag information, create play lists and even has a Freedb menu bar where you can search and automatically generate new tag files for complete CD’s using either Amazon or Discogs search via the web.
It has support for the following audio formats: Flac, Ape, Mp3, iTunes, Ogg and Wma just to name a few.
Homepage
http://www.mp3tag.de
Screenshots
http://www.mp3tag.de/en/screenshots.html
Download
http://www.mp3tag.de/en/download.html
Mp3tag Forums
http://www.anytag.de/forums
To get a listing of all the files in a particular folder on a remote machine is quite easy to accomplish in PowerShell.
For example if you want to see if there are any files in a particular SMS site server inbox you would use something similar to the line below:
Get-ChildItem \\SmsServer\SMS_XXX\Inboxes\Ccrretry.Box
If you were to enter the following:
Get-ChildItem \\SmsServer\SMS_XXX\Inboxes
You will get a listing of all the folders contained in the inboxes on the site server. This will allow you to immediately see all of the Inbox folders so that you can modify the first example to look for files contained in for example the Ddm.Box.
Bill Graziano (SQL Server MVP) has released ClearTrace Version 2.0.24 for SQL server 2000 and 2005. It will allow you to import your SQL profiler trace files into a graphical user interface (GUI) and display summary performance information after reading and querying your traces. Once this is done you can use the group filter to group by application name as well as host of user login.
It is a .NET 2.0 executable and it also comes with a command line version as well.
http://www.cleardata.biz/cleartrace/download.aspx
http://www.cleardata.biz/cleartrace/screenshots.aspx
Instructions
http://www.cleardata.biz/cleartrace/instructions.aspx
Requirements
http://www.cleardata.biz/cleartrace/default.aspx#requirements
Beta Program
http://www.cleardata.biz/cleartrace/beta.aspx
Video Demo
http://www.cleardata.biz/cleartrace/ClearTraceDemo.wmv
Set Fso = CreateObject("Scripting.FileSystemObject")
Set WshShell = WScript.CreateObject("WScript.Shell")
Set drives = Fso.Drives
iIniCount = 0
For Each Drive In Drives
If Fso.FileExists(Drive.DriveLetter&":\Boot.Ini") Then
WshShell.Run "Attrib "& Drive.DriveLetter & ":\Boot.Ini -R -H", 0, False
WshShell.Run "Notepad.Exe " & Drive.DriveLetter & ":\Boot.Ini"
iIniCount = iIniCount + 1
WshShell.Run "Attrib "& Drive.DriveLetter & ":\Boot.Ini +R +H", 0, True
Next
· On average, 100 people choke to death on ballpoint pens every year.
· On average people fear spiders more than they do death.
· In 10 minutes, a hurricane releases more energy than all the world's nuclear weapons combined.
· Thirty-five percent of the people who use personal ads for dating are already married.
· Only one person in two billion will live to be 116 or older.
· Women blink nearly twice as much as men.
· A snail can sleep for three years.
· No word in the English language rhymes with "MONTH".
· Average life span of a major league baseball: 7 pitches.
· Our eyes are always the same size from birth, but our nose and ears never stop growing.
· The electric chair was invented by a dentist.
· "Go." is the shortest complete sentence in the English language. “I Am” is the shortest sentence in the bible.
· A crocodile cannot stick its tongue out.
· The cigarette lighter was invented before the match.
· Americans on average eat 18 acres of pizza every day.
· The "pound" key on your keyboard (#) is called an octotroph.
· The only domestic animal not mentioned in the Bible is the cat.
· Table tennis balls have been known to travel off the paddle at speeds up to 160 km/hr.
· Pepsi originally contained pepsin, thus the name.
· Nutmeg is extremely poisonous if injected intravenously.
· The most common name in the world is Mohammed.
· The volume of the earth's moon is the same as the volume of the Pacific Ocean.
· Chinese Crested dogs can get acne.
· Hydrogen gas is the least dense substance in the world, at 0.08988g/cc.
· Hydrogen solid is the most dense substance in the world, at 70.6g/cc.
· Each year there is one ton of cement poured for each man woman and child in the world.
· The house fly hums in the middle octave key of F.
· The only capital letter in the Roman alphabet with exactly one end point is P.
· Tigers have striped skin, not just striped fur.
· Hummingbirds are the only animals that can fly backwards.
If you are a NASCAR fan or like racing this is definitely for you!
Seeing is believing
This script will read the machine names from a text file called MachineList.Txt and delete the machine(s) from SMS as well as list the machines Resource ID(s) for the deleted machines.
Note: Update your collection membership in the SMS console to reflect the changes.
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
objExcel.Workbooks.Add
intRow = 2
objExcel.Cells(1, 1).Value = "Machine Name"
objExcel.Cells(1, 2).Value = "Site Server"
objExcel.Cells(1, 3).Value = "Site Code"
objExcel.Cells(1, 4).Value = "Resource ID"
objExcel.Cells(1, 5).Value = "Status"
strServer = InputBox("Enter Site Server Name")
strSiteCode = InputBox("Enter Site Code")
Set InputFile = fso.OpenTextFile("MachineList.Txt")
Do While Not (InputFile.atEndOfStream)
strComputer = InputFile.ReadLine
Set locator = CreateObject("WbemScripting.SWbemLocator")
Dim WbemServices1
Set WbemServices1 = locator.ConnectServer( strServer,"root\SMS\site_" & strSiteCode)
objExcel.Cells(intRow, 1).Value = UCase(strComputer)
objExcel.Cells(intRow, 2).Value = UCase(strServer)
objExcel.Cells(intRow, 3).Value = UCase(strSiteCode)
ResID = getResID(strComputer, WbemServices1)
If ResID = Empty Then
objExcel.Cells(intRow, 4).Value = "Unable To Detect"
objExcel.Cells(intRow, 4).Value = ResID
Set sResource = WbemServices1.Get("SMS_R_System='" & ResID & "'")
sResource.Delete_
If Err = 0 Then
objExcel.Cells(intRow, 5).Value = "Removed"
objExcel.Cells(intRow, 5).Value = "Error"
intRow = intRow + 1
Set sResource = NOTHING
loop
Function GetResID(strComputer, oWbem)
Dim strQry
strQry = "Select ResourceID from SMS_R_System where Name=" & "'" & strComputer & "'"
Set objEnumerator = oWbem.ExecQuery(strQry)
If Err <> 0 Then
GetResID = 0
Exit Function
For Each objInstance in objEnumerator
For Each oProp in objInstance.Properties_
GetResID = oProp.Value
End Function
objExcel.Range("A1:E1").Select
objExcel.Selection.Interior.ColorIndex = 19
objExcel.Selection.Font.ColorIndex = 11
objExcel.Selection.Font.Bold = True
objExcel.Cells.EntireColumn.AutoFit
Set oobjExcel = Nothing
Set Fso = Nothing
Set Inputfile = Nothing
Set Locator = Nothing
Set WbemServices1 = Nothing
Set objEnumerator = Nothing
MsgBox "Done"
This SQL query will allow you to find or locate machines in your SMS database that have not reported a Heartbeat discovery record in the last week or seven days.
SD.Netbios_Name0,
A.AgentName,
DI.AgentTime
Inner Join DiscItemAgents DI on SD.DiscArchKey = DI.DiscArchKey
Cross Join Agents A
Where A.AgentName = 'Heartbeat Discovery'
And DatePart (D,DI.AgentTime) >= 7
Roaming and in particular Roaming boundaries is a new concept with SMS 2003. There is some confusion on what the difference is between local and remote roaming as well as global and regional roaming.
To understand these new concepts it is fist necessary to understand what roaming actually is. Put very simply to draw a comparison roaming is much like your cell phone in that you have the ability to move (Roam) from one access point or tower to another and not loose your signal.
SMS 2003 advanced client laptops have the obvious ability to move from one Ethernet connected port to another. Whether it is within the same office building or a building across the continent or in another state. This can also be applied to machines that are connected to an office during the weekdays and a home or dialup connection on the weekends or when you are traveling.
It is important to note here that you can configure two types of boundaries Site boundaries and roaming boundaries. Your legacy SMS clients will use the local boundaries and the advanced client will use both the local and roaming boundaries. So in a nut shell your SMS advanced clients can move from one locale to another and still be managed by SMS. This function is much like travel mode in SMS 2.0 but has been greatly improved upon.
Within SMS 2003 roaming is based on the machines IP address and its subnet. The machine is considered a roaming client when that IP address or subnet changes by any of the means listed above. When you configure your roaming boundaries you can either define them by an IP subnet, a range of IP addresses or an Active Directory site name.
Note: An SMS 2003 site’s roaming boundary is also where the advanced clients locate their Management Point (MP) and Distribution Point (DP) servers for software installation and BITS is used to control or throttle your software installation. Also make note that as the default your site boundaries are also configured as local roaming boundaries.
A Roaming boundary is when your MP or DP is locally available over a well connected LAN link. On the other hand a Remote roaming boundary is one in which the machine is not local or on another segment or a remote or dial up connection.
Regional and Global roaming is defined by Active directory (AD). In Regional roaming if AD is not in place or the schema has not been extended for SMS your advanced clients only have the ability to roam to lower level sites within their site assignment and still receive their software installation packages from the DP.
Global roaming is where AD is in place and the schema has been extended for SMS. This allows your advanced clients can roam to other sites in the SMS hierarchy whether they are higher or lower level sites or child sites and even sites in other SMS sites. The only limitation is that Global roaming cannot be used across AD forests.