This Vbs script will take an SMS site server name and site code from an input box and then enumerate all of the SMS Web Reports on that server. It will then add them to a Microsoft Word document that you can save for future reference. You can also save the document as a webpage or as an XML document if you are using Microsoft Word 2003.
Note: The script uses the SMS_Report class and exposes its SQLQuery lazy property by using the GET instance for the object property and links the Report ID for the appropriate reports. For more information on lazy properties see the link at the end of this post.
Vbs Script:
strComputer = InputBox ("Enter Site Server Name")
strSiteCode = InputBox("Enter Site Code")
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
Set objDoc = objWord.Documents.Add()
Set objSelection = objWord.Selection
objSelection.Font.Bold = True
objSelection.TypeText "SMS Web Reports For " & UCase(strComputer)
objSelection.Font.Bold = False
objSelection.TypeParagraph()
objSelection.TypeText "Report Created: " & Date
Set objWMIService = GetObject("winmgmts://" & strComputer & "\root\sms\site_" & strSiteCode)
Set colItems = objWMIService.ExecQuery("Select * from SMS_Report")
For Each objItem in colItems
ReportQuery(objItem.ReportID)
Next
Function ReportQuery(ReportID)
Set lazyproperties = objWMIService.Get("SMS_Report.ReportID=" & ReportID)
objSelection.TypeText lazyproperties.Name
objSelection.TypeText lazyproperties.SQLQuery
End Function
MsgBox "Done"
Those Lazy SMS Properties:
http://myitforum.com/cs2/blogs/dhite/archive/2006/11/17/those-lazy-sms-properties.aspx
Use this Vbs script to enumerate a subnet range or range of IP addresses to determine which machines are or are not SMS clients and send the results to Excel. It will also attempt to determine the IP address and Machines Name for each IP address as well.
Note: The Subnet range must have the following syntax xxx.xxx.xxx. with the trailing “.” at the end of the first Input box prompt.
To make the script input boxes easier to understand I have added examples for each and the input box will be auto populated with them Change them as needed.
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
objExcel.Workbooks.Add
intRow = 2
objExcel.Cells(1, 1).Value = "IP Address"
objExcel.Cells(1, 2).Value = "Machine Name"
objExcel.Cells(1, 3).Value = "SMS Client"
strSubnet = InputBox("Enter Subnet Range", "strSubnet", "192.168.1.")
intStartingAddress = InputBox("Enter Start Address", "intStartingAddress", "0")
intEndingAddress = InputBox("Enter End Address", "intEndingAddress", "255")
For i = intStartingAddress to intEndingAddress
strTarget = strSubnet & i
Set objPing = GetObject("winmgmts:{impersonationLevel=impersonate}")._
ExecQuery("select Replysize from Win32_PingStatus where address = '" & strTarget & "'")
For Each objItem in objPing
If IsNull(objItem.ReplySize) Then
IsConnectible = False
Else
On Error Resume Next
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strTarget & "\root\cimv2")
Set colCompSystems = objWMIService.ExecQuery("Select * From " & "Win32_ComputerSystem")
For Each objCompSystem In colCompSystems
objExcel.Cells(intRow, 1).Value = strTarget
objExcel.Cells(intRow, 2).Value = UCase(objCompSystem.Name)
Set objWMIService = GetObject("winmgmts://" & strTarget & "/root/ccm")
Set colItems = objWMIService.ExecQuery("Select * from Sms_Client")
If Err.Number = 0 Then
objExcel.Cells(intRow, 3).Value = "YES"
intRow = intRow + 1
objExcel.Cells(intRow, 3).Value = "NO"
End If
objExcel.Range("A1:C1").Select
objExcel.Selection.Interior.ColorIndex = 19
objExcel.Selection.Font.ColorIndex = 11
objExcel.Selection.Font.Bold = True
objExcel.Cells.EntireColumn.AutoFit
Set objExcel = Nothing
Set objPing = Nothing
Set objWMIService = Nothing
Set colCompSystems = Nothing
Set smsClient = Nothing
Wscript.Echo "Done"
This SQL query will count all of the SMS advanced client machines in your SMS database by Active Directory (AD) site. It will also display the client version number as well as the AD site name.
SQL Query:
Select
AD_Site_Name0 'Active Directory Site',
Client_Version0 'SMS Advanced Client Version Number',
Count(*) 'Totals'
From v_R_System
Where Client0 = 1
And Client_Type0 = 1
group by AD_Site_Name0, Client_Version0
order by AD_Site_Name0, Client_Version0
There are a number of ways that you can troubleshoot TCP/IP configuration issues for your SMS clients. The standard process for troubleshooting these issues is using the Ipconfig command line utility from the command prompt on the machine(s) in question.
Listed here you can see all of the available Ipconfig command line switches available to you for troubleshooting purposes.
Ipconfig /all
This command line switch will display the “Detailed” IP configuration of the client machine.
Ipconfig /release
This command line switch will release the current IP address on the client machines network interface card (NIC).
Ipconfig /renew
This command line switch will renew the current IP address on the client machines NIC card.
Ipconfig /flushDns
This command line switch will flush or purge the client machines DNS cache.
Ipconfig /registerDns
This command line switch will refresh all of the NIC cards leased IP addresses and will re-register the DNS names.
Ipconfig /displayDns
This command line switch will display the DNS cache records.
The SMS Service account in both SMS 2.0 and 2003 must be used sparingly and only when necessary. Just as we try not to use the Administrator account on our domain servers we should try and take the heat off the SMS service account as well.
Because the service account and the administrations account are very powerful accounts and can wreak havoc if misused we must protect them as best we can. The SMS service account in particular has many process threads that rely on it and should be protected.
To take the heat off the SMS service account you should have the following accounts created otherwise the SMS service account will manage them:
Client Push Installation account – This account is used by the Client Configuration Manager to install the SMS client software on your machines.
Site Address account – This account is used for site to site communication and data transfers between sites in a parent child configuration.
Site System Connection account – This account is used by the SMS Site server(s) when connecting to its site systems.
Use this Vbs script to get user input from a Vbs Script:
MsgBoxReply = Msgbox("Ready To Visit SpongeBob SquarePants ?",vbYesNo , "SpongeBob SquarePants Rocks !")
If MsgBoxReply = vbYes Then
' Place Your "YES" Code Here And Remove The Line Below.
MsgBox "Ok Then Tell Gary Hello !"
' Place Your "NO" Code Here And Remove The Line Below.
MsgBox "Patrick Will Sure Miss You !"
Note: You can also use the display button value as opposed to the constant for the Yes and No buttons (vbYesNo) in the script above by replacing vbYesNo with the Value of 4 or
as in the Additional Button Display Options listed at the end of this post.
Constant: vbOKOnly
Value: 0
Buttons: OK only
Constant: vbOKCancel
Value: 1
Buttons: OK and Cancel
Constant: vbAbortRetryIgnore
Value: 2
Buttons: Abort, Retry, and Ignore
Constant: vbYesNoCancel
Value: 3
Buttons: Yes, No, and Cancel
Constant: vbYesNo
Value: 4
Buttons: Yes and No
Constant: vbRetryCancel
Value: 5
Buttons: Retry and Cancel
Note: Thanks to Alex for sending this to me and allowing me to modify and post it here.
Have you ever had one of those days when you wish you could call someone “Stupid” or a “Moron” and cannot find it in your heart to just come out and say so? Well then this list is for you. Here you will find a listing of some alternate means of calling someone a “Stupid Moron”:
Note: Your End Losers, I mean End Users (And other customers) are under no circumstances to be called “Stupid” or “Morons” or any of the alternatives below.
Some of the object properties within SMS are lazy. To be more precise they are ‘Lazy Properties’. This simply means that the data exist but it is not exposed to the SMS Query builder or the SMS console. However it can be accessed using WMI or WbemTest.
As an example in the Sms_Advertisement class the AssignedSchedule and StartTime properties are lazy properties. Within the Sms_Pdf_Package the Icon property is an array containing icon data and it is also a lazy property.
As a rule the data is meaningless numeric data and therefore useless to you. And as I mentioned they can be accessed through various programming languages as well as a WMI class viewer.
Programmatically you can use the Get instance for the object to get the data as in the example below taken from the link at the bottom of this page.
Set colAdvertisements = objSWbemServices.ExecQuery("Select * From SMS_Advertisement")
For Each objAdvert In colAdvertisements
WScript.Echo "ActionInProgress = " & objAdvert.ActionInProgress
WScript.Echo "AdvertFlags = " & objAdvert.AdvertFlags
WScript.Echo "AdvertisementID = " & objAdvert.AdvertisementID
WScript.Echo "AdvertisementName = " & objAdvert.AdvertisementName
'For the lazy properties, get the advertisements individually.
Set lazyproperties = objSWbemServices.Get("SMS_Advertisement.AdvertisementID='" & ObjAdvert.advertisementid & "'")
WScript.Echo "Assigned Schedule = {"
For i=0 to ubound(lazyproperties.assignedschedule,1)
WScript.Echo " instance of " & lazyproperties.Properties_("AssignedSchedule").Value(0).Path_.Class
WScript.Echo lazyproperties.Properties_("AssignedSchedule").Qualifiers_("CIMType")
WScript.Echo " DayDuration: " & lazyproperties.AssignedSchedule(i).DayDuration
WScript.Echo " Hourspan: " & lazyproperties.AssignedSchedule(i).HourSpan
WScript.Echo " IsGMT: " & lazyproperties.AssignedSchedule(i).IsGMT
WScript.Echo " StartTime: " & lazyproperties.AssignedSchedule(i).StartTime
WScript.Echo "AssignedScheduleEnabled = " & lazyproperties.AssignedScheduleEnabled
WScript.Echo "AssignedScheduleIsGMT = " & lazyproperties.AssignedScheduleIsGMT
WScript.Echo "}"
WScript.Echo "CollectionID = " & objAdvert.CollectionID
WScript.Echo "Comment = " & objAdvert.Comment
How to Read Lazy Properties
http://www.microsoft.com/technet/prodtechnol/sms/sms2003/maintain/smsscript/script11.mspx?mfr=true
This Vbs script will create directory names contained in an Excel spreadsheet called C:\NewFolders.xls on a server share.
The Excel file must have one directory name per line in Column A as in the example below:
Folder1
Folder2
Folder3
Note: Be sure to change \\ServerName\ShareName\ as needed.
Set objFSO = CreateObject("Scripting.FileSystemObject")
strPathExcel = "C:\NewFolders.xls"
objExcel.Workbooks.open strPathExcel
Set objSheet = objExcel.ActiveWorkbook.Worksheets(1)
intRow = 1
Do Until objExcel.Cells(intRow, 1).Value = ""
strCN = Trim(objSheet.Cells(intRow, 1).Value)
If objFSO.FolderExists("\\ServerName\ShareName\" & strCN) Then
objFSO.CreateFolder("\\ServerName\ShareName\" & strCN)
Loop
objExcel.Quit
Use the queries below to find the installed applications from the Add and Remove programs (MSI Installed) table for a list of machines.
System.Name0,
Programs.DisplayName00 Application,
Programs.Publisher00 Publisher,
Programs.Version00 Version,
Programs.ProdID00 'Product Id',
Programs.InstallDate00 'Install date'
From Add_Remove_Programs_Data Programs
Join System_Disc System on Programs.MachineId = System.ItemKey
Where System.Name0 in
('MachineOne',
'MachineTwo')
Or you could create a collection and query the collection:
Note: _RES_COLL_SMS000ES is the “All windows XP Systems” Collection
Programs.DisplayName00,
Programs.InstanceKey,
Programs.InstallDate00,
Programs.ProdID00,
Programs.Publisher00,
Programs.MachineID,
Programs.RevisionID,
Programs.TimeKey,
Programs.Version00
From System_Disc System
Join Add_Remove_Programs_Data Programs on Programs.MachineID = System.ItemKey
Join _Res_Coll_Sms000ES Collection on Collection.MachineID = System.ItemKey
When you move from standard security to advanced security many of the accounts that were initially created by the SMS setup process will remain on your site system(s) because your clients or other sites may need them.
There are several accounts that you can safely remove if you are sure that they are no longer required.
Note: The accounts that follow are deemed no longer necessary when you have no more legacy clients on your site(s). If you still maintain legacy clients the accounts should not be deleted.
Accounts that can be safely deleted:
CCM Boot Loader (DC)
SMS#_dc
CCM Boot Loader (Non-DC)
SMSCCMBootAcct&
Client Connection
SMSClient_ XXX, (Where XXX is your three letter site code)
Client Services (DC)
SMS&_dc
Client Services (Non-DC)
SMSCliSvcAcct&
Client User Token (DC)
SMSCliToknAcct&
Client User Token (Non-DC)
SMSCliToknLocalAcct&
Internal Client Group
SMSInternalCliGrp
Legacy Client Software Installation
SMS Service account
Note: You can also disable the accounts listed above rather than delete them. Then after a sufficient amount of time has passed and your site(s) are functioning as expected you can then delete them.
You can execute or run your PowerShell .Ps1 scripts from within PowerShell as well as from the Run command as in the example below:
Powershell C:\My_Script.Ps1
If you call the script this way the script will execute as requested however the command window close as soon as the script completes its task(s). To prevent this from happening you can use the -NoExit command to keep the window open until you manually close it as in the example here:
Powershell –NoExit C:\My_Script.Ps1
You can also modify your scripts to write their output to a file such as a Csv file by using the Export function as in the example below:
Gwmi –Class Win32_Service | Select-object Name | Export-Csv C:\ServicesList.Csv –NoTypeInformation
Redmond Magazine is touted as "The independent voice of the Microsoft IT community" and it is not a bad source of information. I would put it up there with TechNet magazine and SQL server magazine as one of the magazines I enjoy reading.
You can visit their webpage at http://redmondmag.com to see the latest and greatest and you can read their magazine on line at: http://redmondmag.com/issue or if you prefer you can subscribe to the free printed issue and have it delivered to your home or office:
https://subscribe.1105pubs.com/sub/MI?WP=NEWFREE&TC=1
The magazine also has the following RSS news aggregator feeds available as well:
Redmond Report
http://redmondmag.com/rss/news
Most Popular Articles
http://redmondmag.com/rss/today
Product Reviews
http://redmondmag.com/rss/products
Forum Posts
http://redmondmag.com/rss/forums
Tech Library
http://redmondmag.com/rss/techlibrary
Tech Library Webcasts
http://redmondmag.com/rss/techlibrary/webcasts
Redmond Radio
http://redmondmag.com/rss/radio
Stellarium version 0.8.1 is a free open source planetarium for your computer. It shows a realistic sky in 3D just like what you see with the naked eye, binoculars or a telescope.
Features in version 0.8.1
Sky
Over 120,000 stars from the Hipparcos catalogue with info. Asterisms and illustrations of the constellations. Images of nebulae. Realistic Milky Way. Very realistic atmosphere, sunrise and sunset. The planets and their satellites.
Interface
A powerful zoom. Time control. Multilingual interface. Scripting to record and play your own shows. Fisheye projection for planetarium domes. Spheric mirror projection for your own dome. Graphical interface and extensive keyboard control. Telescope control.
Visualization
Equatorial and azimuthal grids. Star twinkling. Shooting stars. Eclipse simulation. Skinnable landscapes, now with spheric panorama projection.
Customisability
Add your own deep sky objects, landscapes, constellation images, scripts.
Screenshots
Download Stellarium 0.8.1 For Windows
Download Stellarium 0.8.1 For Mac
Download Stellarium 0.8.1 For Linux
Stellarium Home Page