July 2007 - Posts

Get Current Management Point and Site Code From List Output To Excel

 

This VBS script will take the machine names from a text file called MachineList.Txt and write the machine(s) name, Current Management Point and site code to an excel spreadsheet.

 

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 = "Current Management Point"

objExcel.Cells(1, 3).Value = "Site Code"

 

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")

Set colItems = objWMIService.ExecQuery("Select * from SMS_Authority")

 

For Each objItem in colItems

strSiteCode = Replace(objItem.Name, "SMS:", "")

objExcel.Cells(intRow, 1).Value = UCase(strComputer)

objExcel.Cells(intRow, 2).Value = objItem.CurrentManagementPoint

objExcel.Cells(intRow, 3).Value = strSiteCode

Next

 

intRow = intRow + 1

loop

 

objExcel.Range("A1:C1").Select

objExcel.Selection.Interior.ColorIndex = 19

objExcel.Selection.Font.ColorIndex = 11

objExcel.Selection.Font.Bold = True

objExcel.Cells.EntireColumn.AutoFit

 

Msgbox "Done"

 

Posted by dhite | with no comments
Filed under:

Vbs Script To Send SMS Console Collection Information To Excel

 

Use this Vbs script to send SMS collection information to Excel.

 

Vbs Script:

 

Set objExcel = CreateObject("Excel.Application")

objExcel.Visible = True

objExcel.Workbooks.Add

intRow = 2

 

objExcel.Cells(1, 1).Value = "CollectionID"

objExcel.Cells(1, 2).Value = "CollectionRules"

objExcel.Cells(1, 3).Value = "Comment"

objExcel.Cells(1, 4).Value = "CurrentStatus"

objExcel.Cells(1, 5).Value = "MemberClassName"

objExcel.Cells(1, 6).Value = "Name"

objExcel.Cells(1, 7).Value = "OwnedByThisSite"

objExcel.Cells(1, 8).Value = "RefreshSchedule"

objExcel.Cells(1, 9).Value = "RefreshType"

objExcel.Cells(1, 10).Value = "ReplicateToSubSites"

 

On Error Resume Next

Set Fso = CreateObject("Scripting.FileSystemObject")

 

strComputer = InputBox("Enter Site Server Name")

strSiteCode = InputBox("Enter Site Code")

 

Set objWMIService = GetObject("winmgmts://" & strComputer & "\root\sms\site_" & strSiteCode)

Set colItems = objWMIService.ExecQuery("Select * from SMS_Collection")

 

For Each objItem in colItems

objExcel.Cells(intRow, 1).Value = objItem.CollectionID

objExcel.Cells(intRow, 2).Value = objItem.CollectionRules

objExcel.Cells(intRow, 3).Value = objItem.Comment

objExcel.Cells(intRow, 4).Value = objItem.CurrentStatus

objExcel.Cells(intRow, 5).Value = objItem.MemberClassName

objExcel.Cells(intRow, 6).Value = objItem.Name

objExcel.Cells(intRow, 7).Value = objItem.OwnedByThisSite

objExcel.Cells(intRow, 8).Value = objItem.RefreshSchedule

objExcel.Cells(intRow, 9).Value = objItem.RefreshType

objExcel.Cells(intRow, 10).Value = objItem.ReplicateToSubSites

intRow = intRow + 1

Next

Set colItems = Nothing

Set objWMIService = Nothing

 

objExcel.Range("A1:J1").Select

objExcel.Selection.Interior.ColorIndex = 19

objExcel.Selection.Font.ColorIndex = 11

objExcel.Selection.Font.Bold = True

objExcel.Cells.EntireColumn.AutoFit

 

MsgBox "Done"

 

 

Posted by dhite | with no comments
Filed under:

VBS Script To Return Logical Disk Information For A List Of Machines

 

This VBS script will read the machine names from a text file called MachineList.Txt and return the machines Logical Disk information and send the results to an Excel spreadsheet.

 

The information will include the following: Machine Name, Drive letter, Total Size, Used Space, Free Space and Free Space Percentage.

 

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 = "Drive"

objExcel.Cells(1, 3).Value = "Total Size"

objExcel.Cells(1, 4).Value = "Used Space"

objExcel.Cells(1, 5).Value = "Free Space"

objExcel.Cells(1, 6).Value = "Free Space Percentage"

 

Set objFSO = CreateObject("Scripting.FileSystemObject")

Set objFile = objFSO.OpenTextFile("MachineList.txt", 1)

 

Do Until objFile.AtEndOfStream

strComputer = objFile.ReadLine

Set objWMIService = GetObject("winmgmts://" & strComputer)

 

On Error Resume Next

Set colDisks = objWMIService.ExecQuery("Select * From Win32_LogicalDisk Where DriveType = 3")

For Each objDisk In colDisks

objExcel.Cells(intRow, 1).Value = Ucase(strComputer)

objExcel.Cells(intRow, 2).Value = objDisk.DeviceID

objExcel.Cells(intRow, 3).Value = (FormatNumber(objDisk.Size/ 1024^3, 1)) & " GB"

objExcel.Cells(intRow, 4).Value = (FormatNumber(objDisk.Size/ 1024^3, 1) - FormatNumber(objDisk.FreeSpace/ 1024^3, 1)) & " GB"

objExcel.Cells(intRow, 5).Value = (FormatNumber(objDisk.FreeSpace/ 1024^3, 1)) & " GB"

objExcel.Cells(intRow, 6).Value = FormatPercent(objDisk.FreeSpace/objDisk.Size, 0)

 

If FormatPercent(objDisk.FreeSpace/objDisk.Size, 0) <= "25%" Then

objExcel.Cells(intRow, 6).Font.ColorIndex = 3

Else

End If

 

intRow = intRow + 1

Next

Loop

 

objExcel.Range("A1:F1").Select

objExcel.Selection.Interior.ColorIndex = 19

objExcel.Selection.Font.ColorIndex = 11

objExcel.Selection.Font.Bold = True

objExcel.Cells.EntireColumn.AutoFit

 

MsgBox "Done"

 

Posted by dhite | with no comments
Filed under:

SQL Server Script To Locate Subnets Between Two Given Values

 

This SQL server script will find all of the subnets between two given values that your SMS network discovery has located.

To use this query change the IP octets to the location holders with the subnets that you want to display the values between. For example if you know that you have the SMS subnet boundaries 192.168.102.0 and 192.168.107.0 defined as subnet boundaries for your site you can add the values below to the script:

Where (Ip_Subnets0 > '192.168.99.0' And Ip_Subnets0 < '192.168.110.0')

This will return all the subnets between 100 and 109 that the SMS network discovery process has identified as active or in use. If the subnets 104 and 108 appear in the results pane then you should investigate the reasons why these particular subnets are not boundaries within your SMS site.

SQL Query:


Set NoCount On

 

Select Distinct

Subnets.Ip_Subnets0 Results

From System_Disc

Join System_Ip_Subnets_Arr as Subnets

On System_Disc.ItemKey = Subnets.ItemKey

Where (Ip_Subnets0 > '192.168.0.1'

And Ip_Subnets0 < '192.168.1.254')

 

Set NoCount Off

 

Posted by dhite | with no comments
Filed under:

Component Status Information For A Specified Site

 

This SQL query much like its counterpart in the SMS console will provide you with the component status for you site.

 

SQL Query:

 

Select

Summarizer_Components.SiteCode Site,

Summarizer_Components.MachineName  'Server Name',

Summarizer_Components.ComponentName Component,

 

Case Summarizer_Components.Status

When 0 Then 'OK'

When 1 Then 'Stopped'

When 2 Then 'Critical'

When 3 Then 'Unknown'

Else 'Unknown'

End As 'Current Status',

 

Case Summarizer_Components.State

When 0 Then 'Stopped'

When 1 Then 'Started'

When 2 Then 'Paused'

When 3 Then 'Installing'

When 4 Then 'Re-Installing'

When 5 Then 'De-Installing'

Else 'Unknown'

End As 'Current State',

 

Case Summarizer_Components.Type

When 0 Then 'AutoStarting'

When 1 Then 'Scheduled'

When 2 Then 'Manual'

Else 'Unknown'

End As 'StartUp Type'

 

From summarizer_components

 

-- Change xxx to the Three letter site code you wish to query.

Where Summarizer_Components.SiteCode = 'XXX'

 

Posted by dhite | with no comments
Filed under:

SMS 2003 Recommended Reading

 

Here you will find a list of SMS 2003 reading materials listed in order of publication that I refer readers to when asked for my help on learning SMS. If you need or want to learn SMS or are just hoping to advance your knowledge of SMS this list is for you.

 

It is important to note here that reading the materials presented below is only the first step in becoming proficient in the SMS arena. On the job experience is best way to learn SMS even when you have to learn things “Under Fire” as most of us have done. To augment or expand your learning of SMS myITforum can also be a great asset to have at your disposal and I encourage you to sign up for the daily newsletter and visit WWW.myITforum.Com on a regular basis. 

 

Note: The links for the books here are from Amazon where the cost of the books has been consistently lower than other book seller WebPages or in stores. To save even more on the cost of your purchases I recommend that you look for books marked as Used. Many of these “Used” books are new and have never been used they are just sold on the Amazon storefront for other sellers.

 

Recommended Reading

 

Microsoft Systems Management Server 2003 Administrator's Companion

By Steven D. Kaczmarek

Feb 2004 - CD-ROM

http://www.amazon.com/gp/offer-listing/0735618887/ref=pd_bbs_sr_olp_1/104-6303260-0558366?ie=UTF8&s=books&qid=1185472839&sr=8-1

 

Professional MOM 2005, SMS 2003, and WSUS

By Randy Holloway, Telmo Sampaio, Marcus Oh, and Russ Kaufmann

May 2006

http://www.amazon.com/gp/offer-listing/0764589636/ref=pd_bbs_sr_olp_6/104-6303260-0558366?ie=UTF8&s=books&qid=1185473035&sr=8-6

 

SMS 2003 Recipes: A Problem-Solution Approach

By Greg Ramsey and Warren Byle

Sep 2006

http://www.amazon.com/gp/offer-listing/1590597125/ref=pd_bbs_sr_olp_2/104-6303260-0558366?ie=UTF8&s=books&qid=1185472839&sr=8-2

 

Pro SMS 2003

By Rod Kruetzfeld

Nov 2006

http://www.amazon.com/gp/offer-listing/1590596986/ref=pd_bbs_sr_olp_3/104-6303260-0558366?ie=UTF8&s=books&qid=1185472839&sr=8-3

 

SMS 2003 Administrator's Reference: Systems Management Server 2003

By Ron D. Crumbaker

Nov 2006

http://www.amazon.com/gp/offer-listing/0471749508/ref=pd_bbs_sr_olp_5/104-6303260-0558366?ie=UTF8&s=books&qid=1185472839&sr=8-5

 

Additional Microsoft Documentation Resources:

 

Systems Management Server 2003 Product Documentation

http://www.microsoft.com/technet/sms/2003/library/proddocs.mspx

 

List of technical resources for Systems Management Server 2003

http://support.microsoft.com/kb/828368

 

 

Posted by dhite | with no comments
Filed under:

NetSh Command Line Switches And Examples For Windows 2003 And Windows XP

 

This post will provide you with the available NetSh command line switches and provide you with examples on how to use the utility.

 

NetSh is a network shell command line utility that allows you to display or even modify or otherwise change your Network Interface Card (NIC) settings or configuration on Microsoft windows XP or better local or remote Operating system machines.

 

With the NetSh utility you can also specify the command line arguments to run or execute a script so that you can execute multiple commands from the same execution with the –F switch followed by the script name.

 

NetSh Syntax And Command Switch Reference

 

The basic Syntax of the NetSh is shown directly below followed by a chart with the command line switch and a brief description of each.

 

NetSh [-a AliasFile] [-c Context] [-r RemoteComputer] [{NetshCommand|-f ScriptFile}]

 

Switch

Description

? or Help             

 Displays Help and provides this list of commands.

Add           

 Adds a new configuration entry to a list.

Bridge        

 Changes to the `NetSh Bridge' prompt context.

Delete        

 Deletes a configuration entry as opposed to Add entries.

Diag          

 Changes to the `NetSh Diag' prompt context.

Dump          

 Displays the contents of a configuration script.

Exec          

 Runs a script file.

Firewall      

 Changes to the `NetSh Firewall' prompt context.

Interface     

 Changes to the `NetSh Interface' prompt context.

Ras            

 Changes to the `NetSh Ras' prompt context.

Routing       

 Changes to the `NetSh Routing' prompt context.

Set           

 Updates configuration settings.

Show          

 Displays information available.

WinSock       

 Changes to the `NetSh WinSock' prompt context.

 

Using The NetSh Command Utility

 

To use the NetSh utility you need to open a command prompt window and enter NetSh in the command prompt and press Enter. Then you will be presented with the NetSh prompt NetSh> then enter your command as in the example below that will display or show your current mode for the local machine which should be online: Show Mode

 

If you want to use the NetSh utility from a remote machine at the prompt window and enter: Set Machine MachinName and the NetSh command prompt will change to  [MachineName] NetSh> and at this point the utility behaves as if you were at the remote machine.

 

Tip: To exit the utility enter Bye rather than closing the window manually then the utility will exit and you will once again be returned to the command prompt window where you can enter Exit.

 

NetSh Examples

 

To determine which NIC card is currently using an IP address from the NetSh command prompt window enter Interface and press enter and you will be presented with the NetSh prompt: NetSh Interface>. Then enter IP Show Config. 

 

To change a machine from a static IP address to a DHCP client issue the following using the steps show above. From the NetSh Interface> prompt enter: IP Set Address "Local Area Connection" DHCP

 

To open the Webpage Graphical Interface (GUI) for the NetSh utility at the NetSh Prompt enter: NetSh Diag GUI

 

To view your Firewall configuration from the NetSh command prompt window enter Firewall and press enter and you will be presented with the NetSh prompt: NetSh Firewall> and then enter Show Service.

 

Note: You can also send the results of your commands to a text file with the > redirector such as NetSh Diag GUI > NetShDiag.Txt

 

Additional Information

 

Managing Windows 2000 Networking Components with NetSh

http://www.microsoft.com/technet/community/columns/cableguy/cg1101.mspx

 

 

Posted by dhite | 1 comment(s)
Filed under:

Using PowerShell To Sort Or Remove Duplicates From Text Files

 

Here you will find two PowerShell scripts that will allow you to sort the contents of a text file alphabetically and save the sorted file as a new text file to preserve the original or existing file. The first script merely sorts the contents of a text file. The second script sorts the contents of a text file and also removes any duplicate lines or entries that may be in the original text file.

 

In most of my VBS scripts I have references to a text file called MachineList.Txt. This is the suggested text file name to store a list of machines or IP addresses for the script(s) to use as an input file. This is easier than entering one machine name or IP address at a time into a VBS script and being Lazy as I am it is the way I write most of my scripts. As a result I wrote the PS1 script to sort the MachineList text file and later realized that I had much to my chagrin duplicates in some of the files and wrote the PS1 script to remove the duplicates. Be sure to change the "C:\DirectoryFolder\MachineList.Txt" to the directory folder name and text file name as needed.

 

Sort The Contents Of A Text File

 

$TextFile = $TextFile = "C:\DirectoryFolder\MachineList.Txt"

$NewTextFile = "C:\DirectoryFolder\NewMachineList.Txt"

GC $TextFile | Sort > $NewTextFile

 

Sort And Remove Duplicates From A Text File

 

$TextFile = $TextFile = "C:\DirectoryFolder\MachineList.Txt"

$NewTextFile = "C:\DirectoryFolder\NewMachineList.Txt"

GC $TextFile | Sort | GU > $NewTextFile

 

Additional Related Posts:

 

HTA Script To Remove Duplicates From A Text File

http://myitforum.com/cs2/blogs/dhite/archive/2007/05/27/hta-script-to-remove-duplicates-from-a-text-file.aspx

 

Using The Ultra-Edit Text Editor To Sort And Remove Duplicate Lines From Files

http://myitforum.com/cs2/blogs/dhite/archive/2006/05/21/20470.aspx

 

 

Posted by dhite | with no comments
Filed under:

Too Many Irons In The Fire

 

When a person is said to have too many irons in the fire it means that they have too many projects or activities going on at once. This term comes from the days when village Black Smiths or Smiths were the ones who fashioned Iron for things such as weapons and horse shoes.

 

A Black Smith would begin his day by getting his fire pit coals roaring hot and then he would place several pieces of iron into it to get them red hot so that they could more easily be hammered into their respective shapes. It was a common practice for the Smith to work on a piece and when it began to cool and was harder to shape he would place it back into the colas to get it hot again so it could be more easily worked. If he had several pieces of Iron in the pit he was said to have too many irons in the fire and was considered quite busy.

 

Posted by dhite | 1 comment(s)
Filed under:

Operations Manager 2007 Wiki

 

Maarten Goet's System Center Operations Manager 2007 Wiki is “Dedicated to all things System Center Operations Manager 2007” The site much like Operations Manager 2007 is relatively new but shows great promise as a resource for Operations Manager 2007. The page includes the following:

 

Welcome

http://opsmgr2007.wikidot.com/start

What's new

http://opsmgr2007.wikidot.com/system:what-s-new

General

http://opsmgr2007.wikidot.com/system:general

Installation

http://opsmgr2007.wikidot.com/system:installation

Agents

http://opsmgr2007.wikidot.com/system:agents

Database

http://opsmgr2007.wikidot.com/system:database

Management Server

http://opsmgr2007.wikidot.com/system:management-server

Management Packs

http://opsmgr2007.wikidot.com/system:management-packs

Monitoring

http://opsmgr2007.wikidot.com/system:monitoring

Reporting

http://opsmgr2007.wikidot.com/system:reporting

Consoles

http://opsmgr2007.wikidot.com/system:consoles

Powershell

http://opsmgr2007.wikidot.com/system:powershell

Notification

http://opsmgr2007.wikidot.com/system:notification

Audit Collection Services

http://opsmgr2007.wikidot.com/system:audit-collection-services

Agentless Exception Monitoring

http://opsmgr2007.wikidot.com/system:agentless-exception-monitoring

Screenshots

http://opsmgr2007.wikidot.com/system:screenshots

Downloads

http://opsmgr2007.wikidot.com/system:downloads

Links

http://opsmgr2007.wikidot.com/system:links

Forum

http://opsmgr2007.wikidot.com/forum:start

Recent posts

http://opsmgr2007.wikidot.com/forum:recent-posts

Page tags

http://opsmgr2007.wikidot.com/system:page-tags

 

Operations Manager 2007 Wiki Home Page

http://opsmgr2007.wikidot.com

 

 

Posted by dhite | with no comments
Filed under:

Microsoft RSS Feeds

 

Get notified immediately as new content is published at Microsoft by subscribing to their Really Simple Syndication (RSS) feeds. With RSS you can see the new content as it appears delivered directly to your desktop through news aggregators such as SharpReader, FeedReader, NewsGator and RSS Bandit.

 

Microsoft has a webpage where you can find all of the available RSS feeds in one location on their Microsoft RSS Feeds Directory page that includes Featured Web Feeds, Recently Added Web Feeds as well as Feeds For: Home, Work, Businesses, Developers and IT Professionals. It also has feeds for the following Product Families: Windows, Office, Servers, Developer Tools, Business Solutions, Games & Xbox and Windows Mobile. Or you could simply search by Feed Categories such as Communities, Computer Languages, Downloads, Events & Webcasts, Security, Support and General Topics.

 

Microsoft RSS Feeds Directory

http://www.microsoft.com/rss

 

Posted by dhite | with no comments
Filed under:

Shane Young And Joel Oleson's TechEd Presentations

 

Shane Young posted his and Joel Oleson's Orlando 2007 TechEd presentations for those of us that were not able to attend sunny Florida for TechEd.

 

OFC304 Microsoft Windows SharePoint Services and Microsoft SharePoint Portal Server 2003 Upgrade and Migration

http://www.sharepointupgrade.com/Shared%20Documents/OFC304.pdf

 

OFC207 SharePoint Governance and Information Architecture Guidance

http://www.sharepointupgrade.com/Shared%20Documents/OFC207_Oleson_20070509_175121_TechEd2007%20Governance_Oleson.pdf

 

OFC222 Microsoft SharePoint Products & Technologies 2007: Administrative Architecture and Planning for Deployment, Part 1

http://www.sharepointupgrade.com/Shared%20Documents/OFC222_Oleson_20070509_180832_TechEd2007_Basic_Deployment_Oleson.pdf

 

OFC418 Microsoft SharePoint Products & Technologies 2007: Deployment & Advanced Administration Topics, Part 2

http://www.sharepointupgrade.com/Shared%20Documents/OFC418_Oleson_20070509_175903_TechEd2007_Advanced_Deployment_Oleson.pdf

 

 

Posted by dhite | with no comments
Filed under:

Momresources Org BlogCasts And Videos For MOM 2005

 

How to implement custom scripts in MOM 2005

 

Step-by-step video on how-to implement custom scripts in MOM 2005, by Pete Zerger

http://www.it-jedi.net/videos/Custom_Scripts_in_MOM_2005/Custom_Scripts_in_MOM_2005.html

 

Configuring Overrides in MOM 2005

 

Explanation of overrides in MOM 2005 from  by Gordon McKenna on blogcastrepository.com

http://www.blogcastrepository.com/blogcasts/folders/mom/entry408.aspx

 

Posted by dhite | with no comments
Filed under:

SQL Server 2005 Service Pack 1 Updates

 

Here you will find a list of Microsoft SQL Server 2005 Service Pack 1 Updates with Microsoft descriptions for each.

 

SQL Server Native Client.

Service Pack for Microsoft SQL Server Native Client.

 

SQL Server Native Client (64-Bit).

Service Pack for Microsoft SQL Server Native Client.

 

Setup support files.

Service Pack for the SQL Server support files.

 

Database Services

Service Pack for the SQL Server database engine, and the tools for managing relational and XML data, Replication, and Full-Text Search.

 

Analysis Services

Service Pack for Analysis Services, and the tools used to support online analytical processing (OLAP) and data mining.

 

Notification services

Service Pack for Notification Services, a platform for developing and deploying applications that send personalized, timely notifications to a variety of devices or applications.

 

Reporting services

Service Pack for the Report Server and Report Builder, which manages, executes, renders, and distributes reports.

 

Integration Services

Service Pack for Integration Services, a set of tools and programmable objects used to create and manage packages that extract, transform, and load data, as well as perform tasks.

 

Client components

Service Pack for the interactive management tools for running SQL Server, including SQL Server Configuration Manager, SQL Server Management Studio, SQL Profiler, and Replication Monitor.

 

XML 6.0 Parser.

Service Pack for Microsoft XML 6.0 Parser.

 

XML 6.0 Parser (64-Bit).

Service Pack for Microsoft XML 6.0 Parser.

 

SQLXML 4.0.

Service Pack for Microsoft SQLXML 4.0.

 

SQLXML 4.0 (64-Bit)..

Service Pack for Microsoft SQLXML 4.0.

 

Backward Compatibility

Service Pack for the Backward Compatibility components, including Data Transformation Services Runtime and SQL-DMO.

 

Backward Compatibility  (64-Bit).

Service Pack for the Backward Compatibility components, including Data Transformation Services Runtime and SQL-DMO.

 

Microsoft SQL Server VSS Writer.

Service Pack for Microsoft SQL Server VSS Writer.

 

Microsoft SQL Server VSS Writer  (64-Bit)..

Service Pack for Microsoft SQL Server VSS Writer.

 

A list of the bugs that have been fixed in SQL Server 2005 Service Pack 1

http://support.microsoft.com/?kbid=913090

 

Posted by dhite | with no comments

HTA Script To Gather Page File Information For A Specified Machine

 

This HTA script will allow you to enter a machine name and will then return the following Page file information for the machine to the active window: Page file name, initial size and maximum size.

 

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

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set colItems = objWMIService.ExecQuery("Select * from Win32_PageFile")

For Each objItem in colItems

Window.Document.Title = "Page File Information For : " & UCase(strComputer)

 

strHtml = strHtml & "<td><Font color = Blue>" & "Page File Name: " &  "</Font></td>"

strHtml = strHtml & "<td><Font color = Red>" & UCase(objitem.Name)  & "</Font></Td></Br>"

strHtml = strHtml & "<td><Font color = Blue>" & "Initial Size: " &  "</Font></td>"

strHtml = strHtml & "<td><Font color = Red>" & objitem.InitialSize & " MB" & "</Font></Td></Br>"

strHtml = strHtml & "<td><Font color = Blue>" & "Maximum Size: " &  "</Font></td>"

strHtml = strHtml & "<td><Font color = Red>" & objitem.MaximumSize & " MB" & "</Font></Td></Br>"

Next

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>

 

 

Posted by dhite | with no comments
Filed under:
More Posts Next page »