April 2008 - Posts

VBS Script To Display Distribution Points Agent Service Information

 

This VBS script will take a list of Distribution Point (DP) servers from a text file called DPServers.Txt and will write the SMS Agent Host status for each server to an excel spreadsheet.

 

VBS Script:

 

Set objExcel = CreateObject("Excel.Application")

objExcel.Visible = True

objExcel.Workbooks.Add

intRow = 2

 

Set Fso = CreateObject("Scripting.FileSystemObject")

Set InputFile = fso.OpenTextFile("DPServers.Txt")

Do While Not (InputFile.atEndOfStream)

strComputer = InputFile.ReadLine

 

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

objExcel.Cells(1, 2).Value = "Service Name"

objExcel.Cells(1, 3).Value = "Current State"

 

servicename = "SMS Agent Host"

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

Set colItems = objWMIService.ExecQuery("Select * From Win32_Service Where DisplayName = '" & servicename & "'")

 

For Each objItem in colItems

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

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

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

If objExcel.Cells(intRow, 3).Value = "Stopped" Then

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

End If

 

intRow = intRow + 1

Next

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:

Scripting Special Folders

 

Provided here you will find a VBS script example of how to enumerate local machines specified special folder content. To make the script more robust I have added all of the available Special Folder Constants (Const) so that the script can be modified and reused.

 

The script below will list the contents of the DESKTOP special folder. To use any of the Constants in the list copy and paste the special folder you want to use and substitute the DESKTOP Constant name in the Namespace line with any of the Const values contained in the script as in the examples here:

 

Set objFolder = objShell.Namespace(LOCAL_SETTINGS_HISTORY)

Set objFolder = objShell.Namespace(MY_PICTURES)

Set objFolder = objShell.Namespace(MY_RECENT_DOCUMENTS)

 

VBS Script:

 

Const LOCAL_SETTINGS_HISTORY = &H22&

Const MY_PICTURES = &H27&

Const MY_RECENT_DOCUMENTS = &H8&

Const MY_COMPUTER = &H11&

Const NETHOOD = &H13&

Const PROGRAMS = &H2&

Const PROGRAM_FILES = &H26&

Const RECYCLE_BIN = &Ha&

Const SYSTEM32 = &H25&

Const STARTUP = &H7&

Const START_MENU = &Hb&

Const ADMINISTRATIVE_TOOLS = &H2f&

Const ALL_USERS_APPLICATION_DATA = &H23&

Const ALL_USERS_DESKTOP = &H19&

Const ALL_USERS_PROGRAMS = &H17&

Const ALL_USERS_START_MENU = &H16&

Const ALL_USERS_STARTUP = &H18&

Const APPLICATION_DATA = &H1a&

Const SENDTO = &H9&

Const COMMON_FILES = &H2b&

Const CONTROL_PANEL = &H3&

Const DESKTOP = &H10&

Const FONTS = &H14&

Const COOKIES = &H21&

Const FAVORITES = &H6&

Const LOCAL_APPLICATION_DATA = &H1c&

Const MY_NETWORK_PLACES = &H12&

Const MY_DOCUMENTS = &H5&

Const MY_MUSIC = &Hd&

Const NETWORK_CONNECTIONS = &H31&

Const PRINTERS_AND_FAXES = &H4&

Const PRINTHOOD = &H1b&

Const MY_VIDEOS = &He&

Const TEMPLATES = &H15&

Const TEMPORARY_INTERNET_FILES = &H20&

Const USER_PROFILE = &H28&

Const WINDOWS = &H24&

Const INTERNET_EXPLORER = &H1&

 

Set objShell = CreateObject("Shell.Application")

Set objFolder = objShell.Namespace(DESKTOP)

 

Set colItems = objFolder.Items

For Each objItem in colItems

MsgBox objItem.Name

Next

 

 

 

 

Posted by dhite | with no comments
Filed under:

SQL Query To Find Machines With Torrent Downloading Clients Installed

 

This SQL query will find machines with Peer-To-Peer (P2P) Torrent File Sharing downloading Client’s installed.

 

The script below actually began as a By Request script that I was asked to create for a reader who wanted to know how to find machines with any versions of either UTorrent or BitTorrent installed. Since I know next to nothing about P2P clients I went to the web to find out more information. Then I added some of the more seemingly popular ones to the list. I chose to use “Like” rather than UTorrent.Exe to capture both the actual client applications and install downloads.

 

Note: I am sure that there are more P2P client applications out there specifically for downloading Torrent files so if you find any please comment on this post for the benefit of others.

 

Torrent SQL Query:

 

Select

SD.Name0,

SF.FileName

From v_Gs_SoftwareFile SF

Join v_R_System SD on SD.ResourceId = SF.ResourceId

 

Where SF.FileName Like '%Azureus%'

Or SF.FileName Like '%BitComet%'

Or SF.FileName Like '%BitLord%'

Or SF.FileName Like '%BitPump%'

Or SF.FileName Like '%BitTornado%'

Or SF.FileName Like '%BitTorrent%'

Or SF.FileName Like '%Shareaza%'

Or SF.FileName Like '%Utorrent%'

Order By SD.Name0, SF.FileName

 

Below is a SQL query to find applications that are not only used to download Torrent files but other files as well using P2P technology.

 

Other File Sharing Applications SQL Query:

 

Select

SD.Name0,

SF.FileName

From v_Gs_SoftwareFile SF

Join v_R_System SD on SD.ResourceId = SF.ResourceId

 

Where SF.FileName Like '%BearShare%'

Or SF.FileName Like '%eDonkey%'

Or SF.FileName Like '%Emule%'

Or SF.FileName Like '%Kazaa%'

Or SF.FileName Like '%LimeWire%'

Or SF.FileName Like '%Morpheus%'

Order By SD.Name0, SF.FileName

 

Additional Information

 

Electronic Theft Using Torrents And P2P Technology

http://myitforum.com/cs2/blogs/dhite/archive/2007/03/04/electronic-theft-using-torrents-and-p2p-technology.aspx

 

SMS WQL Query To Locate Users With Prohibited Software

http://www.myitforum.com/articles/1/view.asp?id=2268

 

BitTorrent (protocol)

http://en.wikipedia.org/wiki/.torrent

 

 

 

 

Posted by dhite | with no comments
Filed under:

Disabling Windows Server 2003 Ctrl-ALT-DEL Logon Prompt

 

Here you will find information how to bypass the Ctrl-ALT-DEL Logon Prompt for a Windows 2003 Server.

 

This security setting determines whether pressing CTRL+ALT+DEL is required before a user can log on. If this policy is enabled on a computer, a user is not required to press CTRL+ALT+DEL to log on. Not having to press CTRL+ALT+DEL leaves users susceptible to attacks that attempt to intercept the users' passwords. Requiring CTRL+ALT+DEL before users log on ensures that users are communicating by means of a trusted path when entering their passwords.

 

Note: If this policy is disabled, any user is required to press CTRL+ALT+DEL before logging on to Windows.

 

To disable (Enable) the policies follow the steps below:

 

1. From the Run line or from a command prompt enter GpEdit.Msc and press enter.

 

2. At the Group Policy Object Editor user interface navigate to the following:

 

Computer Configuration

Windows Settings

Security Settings

Local Policies

Security options

 

3. Double click on the policy for “Interactive Logon: Do not require CTRL+ALT+DEL”

 

4. Set the property to “Enabled” and then select “OK” and close the Group Policy Object Editor dialog box

 

 

 

Posted by dhite | with no comments
Filed under:

System Center Essentials 2007 Service Pack 1 Download

 

Here you will find Microsoft provided links to get the information you need prior to applying the System Center Essentials (SCE) 2007 Service Pack (SP) 1 upgrade.

 

Some of the improvements include:

 

Up to 70 percent less memory consumption

Faster User Interface

Support for workgroup joined computers

SNMP v1 devices

Support for Windows Server 2008.

 

What's New in System Center Essentials 2007 Service Pack 1

http://technet.microsoft.com/en-us/library/cc339465.aspx

 

Release Notes for System Center Essentials 2007 Service Pack 1

http://go.microsoft.com/fwlink/?LinkID=111308

 

System Center Essentials 2007 Service Pack 1 Migration Guide

http://www.microsoft.com/downloads/details.aspx?FamilyId=9A7D0A52-4380-46A8-BA80-729AE2CC8CBA&displaylang=en

 

System Center Essentials 2007 Service Pack 1 Operations Guide

http://www.microsoft.com/downloads/details.aspx?FamilyId=DBF51282-1784-4B9F-ABD1-E2B5CB12F1A8&displaylang=en

 

 

System Center Essentials 2007 SP1 Upgrade (x64 & x86)

http://www.microsoft.com/downloads/details.aspx?FamilyId=20824F84-B98A-4E42-93A7-045A7A58E289&displaylang=en

 

 

Posted by dhite | with no comments
Filed under:

IIS 7.0 PowerShell Provider Downloads

 

Overview

The IIS 7.0 PowerShell Provider is a PowerShell Snap-In that allows you to manage IIS7 configuration and run-time data. It gives easy access to Web-Sites, Application Pools, Web Applications, Virtual Directories, request in flight, Worker Processes and .NET Application Domains within Worker Processes.

 

Features

The IIS7 PowerShell Provider allows you to

Create Web-Sites, Web Applications, Virtual Directories and Application Pools

Change Simple Configuration Properties on Web-Sites, Application Pools, Web Applications and Virtual Directories

Add and Change Complex Configuration Settings

Query Run-time Data (Web-Site State, Application Pool State, Currently Executing Requests)

Execute Advanced Configuration Tasks, Scripting, Integration with other PowerShell Snap-Ins and features

Search and Discover Configuration Settings

 

On Line Documentation And Walkthroughs:

 

Getting Started with the IIS 7.0 PowerShell Provider

http://learn.iis.net/page.aspx/428/getting-started-with-the-iis-70-powershell-provider

 

Available Walkthroughs

Installing IIS 7.0 PowerShell Provider 

Introduction to IIS 7.0 PowerShell Provider Namespace

Using the PowerShell Help System 

Creating Web-Sites, Web Applications, Virtual Directories and Application Pools

Changing Simple Configuration Properties on Web-Sites, Application Pools, Web Applications and Virtual Directories

Adding and Changing Configuration Dettings like Handlers and Modules 

Querying and Changing Run-time Data (Web-Site State, Application Pool State, Currently Executing Requests)

Advanced Configuration Tasks

 

Download PowerShell Provider for IIS 7.0 (x86)

http://www.iis.net/downloads/default.aspx?tabid=34&i=1664&g=6

 

Download PowerShell Provider for IIS 7.0 (x64)

http://www.iis.net/downloads/default.aspx?tabid=34&i=1665&g=6

 

 

 

Posted by dhite | with no comments
Filed under:

A Bone To Pick

 

The term A Bone To Pick has its origin in the Animal kingdom in particular the carnivore mammals which are predominantly meat eaters. Pack animals such as wolves and coyotes and even dogs will eat meat from a kill after the alpha or lead male has finished. The lowest ranked members of the pack will thus be left with the few scraps of meat left on the bone and will pick it clean.

 

Today we use the term to imply superiority and if you have a bone to pick with someone it means that you are angry about something they did or said and want to set them strait.

 

 

 

Posted by dhite | with no comments
Filed under:

Operations Manager 2007 Service Pack 1 Information Links

 

Here you will find Microsoft provided links to get the information you need prior to applying the Service Pack (SP) 1 upgrade.

 

Note: If you have the Operations Manager 2007 SP1 RC 1 installed you do not have to uninstall it prior to installing the final version.

 

Complete list of fixes and changes that are included in Operations Manager 2007 SP1

http://go.microsoft.com/fwlink/?LinkId=102042

 

Operations Manager 2007 SP1 Release Notes

http://technet.microsoft.com/en-us/library/cc296234.aspx

 

Operations Manager 2007 Quick Start Guide

http://technet.microsoft.com/en-us/library/bb418758.aspx

 

Operations Manager 2007 SP1 Supported Configurations

http://technet.microsoft.com/en-us/library/bb309428.aspx

 

Operations Manager 2007 Service Pack 1 Upgrade Guide

http://technet.microsoft.com/en-us/library/bb822001.aspx

 

Deployment Guide for Operations Manager 2007 Service Pack 1

http://download.microsoft.com/download/7/4/d/74deff5e-449f-4a6b-91dd-ffbc117869a2/OpsMgr2007_Deployment.doc

 

 

Operations Manager 2007 Service Pack 1 Upgrade Package

http://www.microsoft.com/downloads/details.aspx?FamilyID=ede38d83-32d1-46fb-8b6d-78fa1dcb3e85&DisplayLang=en

 

 

 

Posted by dhite | with no comments
Filed under:

How To Enable Remote Desktop Access To A Windows Vista Machine

 

Here you will find the steps necessary to enable Remote Desktop on a Windows Vista machine.

 

Allowing Remote desktop access to a Windows Vista machine is quite similar to doing so for a Windows XP machine. However as a new user to the Vista operating system you may find like most people that things are not as easy to find in Vista. This is particularly true if you have been using Windows XP for quite some time as I have.

 

Follow the steps here to enable the Vista Remote Desktop access:

 

1. From the control panel open the System applet and select “Remote Settings” from the Tasks leaf.

 

2. From the Remote Desktop leaf select either of the following:

 

Allow Connections from Computers Running Any Version of Remote Desktop (less secure)

 

Allow Connections only from Computers Running Any Version of Remote Desktop with Network Level Authentication (more secure)

 

3. Then select “OK” and close the control panel.

 

 

 

Posted by dhite | with no comments
Filed under:

SQL Server 2008 Versions

 

Here you will find information that will help you decide what version of Microsoft SQL Server 2008 you will need to fit your needs.

 

Enterprise

Full featured version including both the core database engine and add-on services including SQL Server cluster abilities.

 

Standard

Includes the core database engine as well as stand-alone services. It differs from Enterprise edition in that it supports less number of active instances (number of nodes in a cluster) and does not include some high-availability functions such as hot-add memory (allowing memory to be added while the server is still running), and parallel indexes.

 

Workgroup

Includes the core database functionality but does not include the additional services.

 

Compact

Available as a free download, build stand-alone and occasionally connected applications for mobile devices, desktops, and Web clients on all Microsoft Windows platforms

 

Express

Available as a free download, Express is ideal for learning and building desktop and small server applications and for re-distribution by ISVs.

 

 

Posted by dhite | with no comments

HTA Script To Retrieve Heartbeat Discovery Information

 

This HTA script will allow you to enter a server name and site code into the provided text boxes and will enumerate all of the machines and their last logged on user name as well as the Heartbeat discovery agents time stamp. 

 

 

Machine Name

User Name

Time Stamp

Machine One

User A

4/15/2008 3:04:50 PM

Machine Two

User B

4/11/2008 11:39:46 AM

Machine Three

User C

4/15/2008 4:17:34 PM

Machine Four

User D

2/19/2008 9:19:01 AM

Machine Five

User E

2/29/2008 9:49:17 PM

 

 

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>

Window.Document.Title = "Heartbeat Discovery Information"

Sub WindowsLoad

strSqlServer = SqlServer.value

strDatabase = Database.value

 

strHTML = "<table border='1' style='border-collapse: collapse' bordercolor='SaddleBrown' id='Table1' >"

strHTML = strHTML & "<tr>"

strHTML = strHTML & "<br>"

strHTML = strHTML & "<td width='10%' bgcolor = 'SeaShell'><font color = 'Blue'><b>Machine Name</td>"

strHTML = strHTML & "<td width='10%' bgcolor = 'SeaShell'><font color = 'Blue'><b>User Name</td>"

strHTML = strHTML & "<td width='10%' bgcolor = 'SeaShell'><font color = 'Blue'><b>Time Stamp</td>"

strHTML = strHTML & "</tr>"

 

Const adOpenStatic = 3

Const adLockOptimistic = 3

Set objConnection = CreateObject("ADODB.Connection")

Set objRecordSet = CreateObject("ADODB.Recordset")

objConnection.Open "Provider=SQLOLEDB;Data Source =" & strSqlServer & ";" & _

"Trusted_Connection=Yes;Initial Catalog =SMS_" & strDatabase

objRecordSet.Open _

"Select SD.Name0, SD.User_Name0, AN.AgentTime, " & _

"AN.AgentName From v_R_System SD " & _

"Join v_AgentDiscoveries AN on SD.ResourceID = AN.ResourceId " & _

"Where AN.AgentSite = 'XXX' And AN.AgentName = 'Heartbeat Discovery' " & _

"Group By SD.Name0, SD.User_Name0, AN.AgentTime, AN.AgentName " & _

"Order By SD.Name0 ", objConnection, adOpenStatic, adLockOptimistic

 

On Error Resume Next

objRecordSet.MoveFirst

Do Until objRecordset.EOF

strHTML = strHTML & "<tr>"

Window.Document.Title = UCase(GetItems.Value) & " - Collection User Information "

strHTML = strHTML & "<td width='1%'>" & objRecordset.Fields.Item("Name0") & "</td>"

strHTML = strHTML & "<td width='1%'>" & objRecordset.Fields.Item("User_Name0") & "</td>"

strHTML = strHTML & "<td width='1%'>" & objRecordset.Fields.Item("AgentTime") & "</td>"

objRecordset.MoveNext

Loop

 

objRecordSet.Close

objConnection.Close

strHTML = strHTML & "</tr>"

strHTML = strHTML & "</table>"

DataArea.InnerHTML = strHTML

End Sub

 

</script><Body>

<p><h3 align = center><font color='Orange'>Please Visit myITforum.Com</font></h3><div></div>

SQL Server Name: <Input Type = "Text" Name = "SqlServer">

Database Name: <Input Type = "Text" Name = "Database">

<input id=DisplayButton class="button" type="button" value="Run Script" name="DisplayItems_button" onClick="WindowsLoad">

</body></html>

<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:

SMS Query Excel Extract Tool For Configuration Manager 2007

 

Provided here for download is my modified version of the SmsExtract Excel query extract tool utility originally available on the BackOffice Resource Kit 4.5 for SMS 2.0.

 

Original Documentation Information:

 

Query Extract (SMSEXTRACT.XLT, SMSEXTRACT.XLS). These Microsoft Excel and Access files enable you to extract data from the SMS database directly into Office applications. The macros return a list of existing queries. A query must already be created and configured in SMS for this to work. Currently, this is the only method to print the results of a query. Query results cannot be printed directly from the console (in version 1.1 or earlier).

 

Query Extract Download: 

http://www.myitforum.com/inc/arts/12126SmsQueryExtract.zip

 

 

 

Posted by dhite | with no comments
Filed under:

Wisdom From The American Military

 

A slipping gear could let your M203 grenade launcher fire when you least expect it. That would make you quite unpopular in what’s left of your unit.

Army’s magazine of preventive maintenance

 

Aim towards the enemy.

Instruction printed on U.S. rocket launcher

 

Any ship can be a minesweeper. Once. 

 

Five-second fuses only last three seconds.

Infantry Journal

 

If something hasn’t broken on your helicopter, it’s about to.

 

If your attack is going too well, you’re walking into an ambush.

Infantry Journal

 

It is generally inadvisable to eject directly over the area you just bombed.

U.S. Air Force Manual

 

The three most common expressions (or famous last words) in aviation are: “Why is it doing that?”, “Where are we?” and “Oh S...!”

 

When the pin is pulled Mr. Grenade is not our friend.

U.S. Marine Corps

 

Whoever said the pen is mightier than the sword obviously never encountered automatic weapons.

General MacArthur

 

 

 

Posted by dhite | with no comments
Filed under:

VBS Script To Export SMS WQL User Group Resource Queries To Microsoft Word

 

This Vbs script will take an SMS site server name and site code from an input box and then enumerate all of the User Group queries on that server and read their corresponding WQL Queries. It will then write them to a Microsoft Word document that you can save for future reference.