This VBS script will take a list of SMS client machine names from a text file called MachineList.Txt and will write the following SMS cache configuration information to an excel spreadsheet: The cache’s present location, current size and if it is currently in use.
For more information see my post entitled: The SMS Advanced Client Temporary Program Download Folder Cache here:
http://myitforum.com/cs2/blogs/dhite/archive/2007/03/24/the-sms-advanced-client-temporary-program-download-folder-cache.aspx
VBS Script:
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 = "Location"
objExcel.Cells(1, 3).Value = "Size (MB)"
objExcel.Cells(1, 4).Value = "In Use"
On Error Resume Next
Set Fso = CreateObject("Scripting.FileSystemObject")
Set InputFile = fso.OpenTextFile("MachineList.Txt")
Do While Not (InputFile.atEndOfStream)
strComputer = InputFile.ReadLine
Set objWMIService = GetObject("winmgmts://" & strComputer & "/root/ccm/SoftMgmtAgent")
Set colItems = objWMIService.ExecQuery("Select * from CacheConfig")
For Each objItem in colItems
objExcel.Cells(intRow, 1).Value = UCase(strComputer)
objExcel.Cells(intRow, 2).Value = objItem.Location
objExcel.Cells(intRow, 3).Value = objItem.Size
objExcel.Cells(intRow, 4).Value = objItem.InUse
intRow = intRow + 1
Next
Set colItems = Nothing
Set objWMIService = Nothing
Loop
objExcel.Range("A1:D1").Select
objExcel.Selection.Interior.ColorIndex = 19
objExcel.Selection.Font.ColorIndex = 11
objExcel.Selection.Font.Bold = True
objExcel.Cells.EntireColumn.AutoFit
This VBS script will take a local or remote machine name from an input box and then will prompt you to enter a Cache size in MB that you want to change the Cache size to. The script will then stop and then start the SMS Agent Host by Name (CCMExec) to apply the change without the need to restart the service manually as is required when modifying the cache.
Note: The Put method (Put_) is designed to be used when you either create or update a WMI instance or a class object and writes the changes to the specified WMI repository.
strComputer = InputBox ("Enter Machine Name")
intCacheSize = InputBox ("Enter New Cache Size (MB)")
objItem.Size = intCacheSize
objItem.Put_ 0
MsgBox "The Cache On " & UCase(strComputer) & " Located At: " & objItem.Location & " Will Be Changed To: " & objItem.Size & " MB"
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Service Where Name = 'CCMExec'")
objItem.StopService(strServiceName)
Wscript.Sleep 10000
objItem.StartService(strServiceName)
MsgBox "Done"
This article will provide you with an example of how you can grant Select permissions to the smsschm_users and webreport_approle accounts to a new or existing SMS view programmatically using a SQL query as opposed to using the SQL Server Management Studio.
If you have created a SQL view and referenced that view in a web report and the select permissions have not been applied for the smsschm_users and webreport_approle accounts you may receive the following error when executing your web report(s):
An error occurred when the report was run. The details are as follows:
SELECT permission denied on object 'View_Name', database 'SMS_XXX', owner 'dbo'.
Error Number: -2147217911
Source: Microsoft OLE DB Provider for SQL Server
Native Error: 229
If you already have an existing view created and you want to grant Select permissions to the smsschm_users and the webreport_approle accounts execute this command from within the query window of your SMS Database after changing View_Name to the name of your existing view:
Grant Select On View_Name To smsschm_users, webreport_approle
If you have not yet created your view use this script below as a template for creating new views to use as SMS web reports. The template script will first check for the presence of the specified view and if it is found the view will be deleted or dropped. Next the template will create the specified view and then grant the appropriate Select permission to the smsschm_users and the webreport_approle accounts:
If Exists (Select * From dbo.SysObjects Where ID = Object_ID(N'[View_Name]')
and ObjectProperty(ID, N'IsView') = 1)
Drop View View_Name
Go
Create View View_Name As
<Your_Sql_Query_Here>
Note: Be sure to change all four instances of View_Name to the name of your view.
Using this template on a regular basis to create your views for using in your SMS web reports will ensure that you apply the appropriate Select permissions and will allow you to consistently create your views for the SQL database. For example you have the following simple SQL query that will associate the System_Disc tables User_Name0 column with the User_Disc tables Full_User_Name0 column that you want to use as a web report:
Select
SD.Name0,
SD.User_Name0,
UD.Full_User_Name0
From System_Disc SD
Join User_Disc UD on SD.User_Name0 = UD.User_Name0
Using the SQL template above you would simply replace the line that reads <Your_Sql_Query_Here> with the SQL query example above as shown here:
Then you can test the view from within the SQL query window by executing the following:
Select * From View_Name
From this point on it is just a matter of creating the web report as normal.
On Thursday March 22nd Microsoft published their List of updates that have been applied to the recently released Windows Server 2003 Service Pack 2. There are a number of significant and important updates included as well as some such as font updates that seem to me to merely occupy space. However somewhere out there someone along the line pointed out that “Some characters from End User Defined Character (EUDC) fonts do not appear correctly in Windows XP” and the fix was incorporated.
It is interesting to note in looking at the supported platforms below that Windows XP Professional x64 Edition is also supported. Is Microsoft going to make this the rule going forward that Service packs for Windows XP Professional x64 will be applied via the Windows 2003 server service packs rather than the XP service packs or is this just a one time event but I digress so I will cease?
Supported Platforms:
Windows Server 2003 All Editions (32-bit x86)
Windows Server 2003 Itanium-based Editions
Windows Server 2003 x64 Editions
Windows Server 2003 R2 Editions
Windows Server 2003 Storage Server R2 Edition
Windows Server 2003 Compute Cluster Edition
Windows Server 2003 for Small Business Servers R2 Edition
Windows XP Professional x64 Edition
List of updates in Windows Server 2003 Service Pack 2:
http://support.microsoft.com/kb/914962
Use this PowerShell script to export a specified machine’s installed Win32_Product information to a Csv file.
PowerShell Script:
$MachineName = Read-Host "Enter Machine Name"
Gwmi -Name Root\Cimv2 -cl Win32_Product –Comp $MachineName |
Select Name, Version |
Export-Csv C:\Win32_Product.Csv –NoType
A spelling alphabet is a set of words which are used to represent the letters of the alphabet. It is particularly useful when reading serial numbers or product keys out loud to people either on the telephone or across the room where they do not have the ability to read your alphanumeric string.
Using the list below you can avoid any confusion when repeating simple or long complex alphanumeric stings to someone by replacing the word associated with the letter of the alphabet when speaking to others. For example this alphanumeric string: MOM2005 can be read as: Mike, Oscar, Mike 2, 0, 0, 5.
To have this reference available when the need arises you can copy and paste the spelling alphabet below into Word or Notepad then print it and place it in your office somewhere near your telephone.
A = Alpha
B = Bravo
C = Charlie
D = Delta
E = Echo
F = Foxtrot
G = Golf
H = Hotel
I = India
J = Juliet
K = Kilo
L = Lima
M = Mike
N = November
O = Oscar
P = Papa
Q = Quebec
R = Romeo
S = Sierra
T = Tango
U = Uniform
V = Victor
W = Whisky
X = X-ray
Y = Yankee
Z = Zulu
During WWII American paratroopers began the tradition of yelling Geronimo! after jumping out of airplanes. However Jumping and Geronimo do not really go hand in hand. Geronimo (1829-1909) was a Chiricahua Apache leader who died at Fort Sill Okalahoma at the age of 85 from pneumonia after he fell from his horse and lay on the ground all night.
The tradition has its origins in a 1939 movie called “Geronimo” that paratroopers had watched as they were beginning their paratrooper training in 1940. According to the legend after a group of paratroopers watched the movie at Fort Benning Georgia one in particular an Army private named Aubrey Eberhardt decided to shout Geronimo! as he was jumping from the pane the next day and the expression caught on.
Several folks have asked why they get poor results and loose all of the formatting when they attempt to copy and paste myITforum Blog content of the many code examples from my Blog in particular to use for their own.
As far as my Blog content is concerned the content is Microsoft Word compatible and you can copy and paste any of the content from my posts into Microsoft Word and not loose any of the layout formatting or syntax color highlighting. Then simply copy and paste the Microsoft Word document content into your favorite code editor or into notepad and save the file with the appropriate file extension and the format will be preserved without the extraneous blank line spaces.
For example if you find a particular Vbs or Sql script that you want to use or modify for your own purposes (Which I wholeheartedly encourage you to do) highlight the text just under the header which usually begins with VBS Script: or SQL Script: to the end of the script and copy and then paste the text into Word and then copy and paste the Microsoft Word content into notepad or other text based editor.
If you are using a news reader such as SharpReader or BlogJet you can use the same process from there as you can from the Blog pages themselves.
The MOM 2005 Resource Kit (MOM2005ResKit.Msi) includes a command line utility in the Tools directory in a folder called “Convert Management Packs to XML” that will allow you to convert MOM Management Pack Binaries (AKM files) to XML format.
The Utility (Mp2Xml.Exe) only has two arguments ‘Input’ and ‘Output’ and is quite easy to use. However you must be aware that the default MicrosoftOperationsManager2005.Akm files which is originally 336 KB when converted to XML format will balloon into a whopping 1,826 KB XML file.
To convert your Management Pack Binaries to XML files use the following syntax:
Mp2Xml.Exe File_Name.Akm File_Name.Xml
For example create a batch file (Unless you like typing into a command prompt window) in the “Convert Management Packs to XML” directory folder with the following ConvertToXml.Bat Contents syntax and execute it:
ConvertToXml.Bat Contents
Mp2Xml.Exe "C:\Program Files\Microsoft Operations Manager 2005\Management Packs\MicrosoftOperationsManager2005.akm" "C:\Program Files\Microsoft Operations Manager 2005\Management Packs\MicrosoftOperationsManager2005.Xml"
When executed this particular batch file will take the MicrosoftOperationsManager2005.Akm file and convert in into a file called MicrosoftOperationsManager2005.Xml.
In a previous post on the Microsoft Office SharePoint Designer 2007 Free Trial Download we talked very briefly about the high level aspects of the MOSS Designer. Here we will go into a little more detail about this remarkable little application.
The best part of the application is that it allows you to create professional looking pages without the need to write a lot of code. For the lazy admins such as me this is most definitely a plus.
You can automate your processes for approving documents and ease the burned of your other collaboration tasks using the workflow designer. There is even the option for creating custom event notification. The reporting and tracking aspects can be quite useful as well by allowing you to make use of data views as well as forms that will allow you to aggregate data both local and remote to your MOSS site and use that data in your document libraries or other lists.
One of the best uses for the MOSS Designer is that you can download the New Application Templates for Windows SharePoint Services 3.0 and use the MOSS designer to further customize all 40 of them to your liking.
New Application Templates for Windows SharePoint Services 3.0
http://www.microsoft.com/technet/windowsserver/sharepoint/wssapps/templates/default.mspx
With the MOSS Designer you can also use Microsoft ASP.NET technology much like you can with Microsoft Visual Studio 2005 to fully customize your pages by adding menus and other controls to make your site truly standout.
Microsoft Office SharePoint Designer 2007 Free Trial Download
http://myitforum.com/cs2/blogs/dhite/archive/2007/03/11/microsoft-office-sharepoint-designer-2007-free-trial-download.aspx
The SqlPerf Database Consistency Check (DBCC) command most of which is undocumented with the exception of the LogSpace option in the SQL Books On Line (BOL) can be used to monitor the performance statistics of your SQL 2005 database.
Here you will find brief descriptions and examples of each of the DBCC SqlPerf Commands to use on your SQL 2005 server.
DBCC SqlPerf (LogSpace)
The LogSpace option retrieves information about the transaction logs for all of the databases on the server and it writes the following: Database Name, Log Size (MB), Log Space Used (%) and Status.
Example: Exec ('DBCC SqlPerf (logspace)')
DBCC SqlPerf (UmsStats)
The UmsStats option retrieves information for your threads and it writes the following: Statistic and Value which includes statistic information on the following: Scheduler ID, Num users, Num runnable, Num workers, Idle workers, Work queued, Cntxt switches, Cntxt switches(idle), cheduler ID, Num users, Num runnable, Num workers, Idle workers, Work queued, Cntxt switches, Cntxt switches(idle), Scheduler Switches
and Total Work
Example: Exec ('DBCC SqlPerf (UmsStats)')
DBCC SqlPerf (WaitStats)
The WaitStats option retrieves information for the servers resources wait types and it writes the following: Wait Type, Requests, Wait Time and Signal Wait Time
Example: Exec ('DBCC SqlPerf (WaitStats)')
DBCC SqlPerf (IoStats)
The IoStats option retrieves information about your server’s outstanding reads and writes and it writes the following: Statistic and Value which includes statistic information on the following: Reads Outstanding and Writes Outstanding.
Example: Exec ('DBCC SqlPerf (IoStats)')
DBCC SqlPerf (RaStats)
The RaStats option retrieves information about your servers read-ahead statistics and it writes the following: Statistic and Value which includes information on the following: RA Pages Found in Cache, RA Pages Placed in Cache, RA Physical IO and Used Slots
Example: Exec ('DBCC SqlPerf (RaStats)')
DBCC SqlPerf (Threads)
The Treads option retrieves information for the server’s currently running threads and writes and it writes the following: Spid, Thread ID, Status, LoginName, IO, CPU and MemUsage
Example: Exec ('DBCC SqlPerf (Threads)')
This HTA script will take an SMS client machine name from an input text box and then return the SMS clients cache configuration information including its present location, current size and if it is currently in use to the active window.
HTA Script:
<Html>
<Head>
<Title>HTA Script</Title>
<Style>
Body {Background-Color: CornSilk}
</Style>
<HTA:Application
Caption = Yes
Border = Thick
ShowInTaskBar = No
MaximizeButton = Yes
MinimizeButton = Yes>
<Script Language = VBScript>
Sub WindowsLoad
strComputer = MachineName.Value
Window.Document.Title = "Cache Configuration For: " & UCase(strComputer)
strHtml = strHtml & "<td><Font color = Green> Location: </Font></Td>" & objItem.Location & "</Br>"
strHtml = strHtml & "<td><Font color = Green> Size: </Font></Td>" & objItem.Size & " MB" & "</Br>"
strHtml = strHtml & "<td><Font color = Green> In Use: </Font></Td>" & objItem.InUse & "</Br>"
strHtml = strHtml & "</Br>"
DataArea.InnerHtml = strHtml
End Sub
</Script><Body>
Enter Machine Name: <Input Type = "Text" Name = "MachineName">
<Input Type = "Button" Value = "Run Script" Name = "Run_Button" onClick = "WindowsLoad"><P>
<Span Id = "DataArea"></Span></Body><Div Align = "Center">
<P><A Href="http://myitforum.com/cs2/blogs/dhite">Created For myITforum By Don Hite</A>
When you view the “Systems Management” applet in the control panel on the “Advanced” tab you will see in the bottom leaf a section called “Temporary Program Download Folder”. In this section you specify in Megabytes (MB) how much of the client’s disk space is to be allocated when an advance client receives an advertisement that is configured to downward the program locally. If this is the case it is downloaded to the Temporary Program Download Folder’s “Current Location” which is by default located in the %WinDir%\System32\CCM\Cache directory folder.
From the”Advanced” tab you can modify the “Amount of disk space to use” by moving the slider, using the up and down arrows or by manually adding the value into the window. You can also change this programmatically using various scripting technologies which is beyond the scope of this post.
<