June 2006 - Posts

Microsoft Common Console (MMC) Document Shortcuts

 

Here you will find a list of many of the Microsoft Common Console Documents that are available for use with Microsoft Windows XP and Microsoft Windows 2003 Server. These can be executed from the command line, from your Start – Run line or via a script such as a batch file or a VBS script.

 

Note: An MSC is a Microsoft Common Console Document as designated by the .Msc file extension.

 

Active Directory Domains And Trusts  

Domain.msc

 

Active Directory Management 

Admgmt.msc

 

Active Directory Schema         

Schmmgmt.msc

 

Active Directory Sites And Services     

Dssite.msc

 

Active Directory Users And Computers           

Dsa.msc

 

Authorization Manager 

Azman.msc

 

Certificate Templates   

Certtmpl.msc

 

Certificates      

Certmgr.msc

 

Certification Authority  

Certsrv.msc

 

Component Services    

Comexp.msc

 

Computer Management           

Compmgmt.msc

 

Device Manager          

Devmgmt.msc

 

DHCP 

Dhcpmgmt.msc

 

Disk Defragmenter       

Dfrg.msc

 

Disk Management        

Diskmgmt.msc

 

Distributed File System (DFS) 

Dfsgui.msc

 

DNS   

Dnsmgmt.msc

 

Event Viewer   

Eventvwr.msc

 

Group Policy   

Gpedit.msc

 

Indexing Service          

Ciadv.msc

 

IP Address Management         

Ipaddrmgmt.msc

 

Local Security Settings             

Secpol.msc

 

Local Users And Groups         

Lusrmgr.msc

 

Performance    

Perfmon.msc

 

Public Key Management          

Pkmgmt.msc

 

Remote Desktops        

Tsmmc.msc

 

Remote Storage           

Rsadmin.msc

 

Removable Storage     

Ntmsmgr.msc

 

Removable Storage Operator Requests            

Ntmsoprq.msc

 

Resultant Set Of Policy            

Rsop.msc

 

Services          

Services.msc

 

Shared Folders            

Fsmgmt.msc

 

SMS Console  

Sms.msc

 

SQL Server Configuration Manager     

SQLServerManager.msc

 

Telephony       

Tapimgmt.msc

 

UUID Services Console          

Uddi.msc

 

Windows Management Infrastructure (WMI) 

Wmimgmt.msc

 

WINS 

Winsmgmt.msc

 

 

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

Creating a Microsoft Excel Spreadsheet With Excel Color Values VB Script

In response to questions I have received about Sending Vbs Results to Microsoft Excel files here is a brief script that will create a numeric list of the colors available for use with the Excel objects Interior and Font Color Indexes.

In my previous post examples I have lines that read as follows that sets the color values for the Interior (Background) and Font Colors:

After running the Vbs script below a Microsoft Excel workbook will open with the colors available for use with the Excel Object ColorIndex(s) and their associated numeric values.

To modify my original posts change the numeric values 19 or 11 with the colors numeric values of your choice.

For example if you want the font to appear as yellow (6) and the cells background to appear as a light gray (15) change the script lines above as follows:

objExcel.Selection.Interior.ColorIndex = 15
objExcel.Selection.Font.ColorIndex = 6


Vbs Script:


Set objExcel = CreateObject("Excel.Application")

objExcel.Visible = True

objExcel.Workbooks.Add

For a = 1 to 56

objExcel.Cells(a, 1).Value = a

objExcel.Cells(a, 1).Interior.ColorIndex = a

Next

 

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

By Request Changing Column Data In SQL Server

 

There may be times when you need to modify data within a SQL table. This can be a daunting process if you have many renames or other changes to make. You need to use the SQL “Update” command to accomplish this.

 

The basic syntax is as follows:

 

Update <TableName>

Set <Column> = '<NewDataValue>'

Where <Column> = '<ExistingDataValue>'

 

Using the NorthWind database as an example we can use the “Employees” table to change all occurrences of "Sales Representative" to "Sales Rep" using the query below:

 

Update Employees

Set Title = 'Sales Rep'

Where Title = 'Sales Representative'

 

If you have multiple changes to make within the same table the simplest way to accomplish this without writing a lot of code is to simply copy, paste and modify your existing query.

 

For example if we wanted to change all occurrences of "Sales Representative" to "Sales Rep" and all of the occurrences of " Vice President, Sales" to "Sales VP" we would copy the exiting query and paste it twice adding the keyword “GO” in between the two statements and modifying one of them to reflect the additional change as in the final example below:

 

Update Employees

Set Title = 'Sales Rep'

Where Title = 'Sales Representative'

 

Go

 

Update Employees

Set Title = 'Sales VP'

Where Title = 'Vice President, Sales'

 

To verify the change exectute the following query:

 

Select Title From Employees

 

Warning: Do not attempt this on a production SMS or MOM database server.

 

Posted by dhite | with no comments
Filed under: ,

WMI Namespace Errors In CCMSetup Log file

 In your SMS client systems CcmSetup.Log file in the CcmSetup directory you may see any one of the following errors or warnings:

 

* MSI: Setup was unable to create the WMI namespace CCM
The error code is 80041001

 

* MSI: Warning 25101. Setup was unable to delete WMI namespace CIMV2\SMS
The error code is 80041001

 

* Client installation has failed too many times. Ccmsetup will now abort.
 
* Installation failed with error code 1603
 
What this is basically telling you is that WMI is out to lunch and has been reported as AWOL. To resolve these log file issues you must delete or rename the machines WMI Repository and allow it to recreate itself.

 

Follow the steps below to accomplish this:

 

1. Stop the "Windows Management Instrumentation" service.

 

2. Rename the %WinDir%\System32\Wbem\Repository folder to ”Oldrepository”.

 

3. Restart the “Windows Management Instrumentation service”.

 

4. Verify that the %WinDir%\System32\Wbem\Repository folder has been recreated.

 

5. Reinstall the SMS client software.

Posted by dhite | with no comments
Filed under:

By Request Write SMS Component Info To Text File VB Script

 

In a previous post entitled “Write SMS Component Info To Excel VB Script” I showed how you could send the results of the Control Panels ‘System Management’ applets ‘System Management properties’ components tab to a Microsoft Excel spreadsheet using the input box to enumerate a specific machine.

 

Here is an example of how to grab the same information but write the results to a text file that will be placed in the same directory from which the script is executed from.

 

 

Vbs Script:

 

Dim oCPAppletMgr

Dim oClientComponents

Dim oClientAction

 

Const ForAppending = 8

Set objFSO = CreateObject("Scripting.FileSystemObject")

Set objTextFile = objFSO.CreateTextFile("Results.txt", True)

 

strComputer = InputBox("Enter Machine Name To Query")

 

Set oCPAppletMgr = CreateObject("CPApplet.CPAppletMgr", strComputer )

Set oClientComponents = oCPAppletMgr.GetClientComponents()

 

For Each oOption In oClientComponents

objTextFile.WriteLine("Machine Name: " & strComputer)

objTextFile.WriteLine("Component: " & oOption.DisplayName)

objTextFile.WriteLine("Version: " & oOption.Version)

Select Case oOption.State

Case 0 objTextFile.WriteLine "State: Installed"

Case 1 objTextFile.WriteLine "State: Enabled"

Case Else objTextFile.WriteLine "State: Unknown"

End Select

objTextFile.WriteLine("")

Next

 

objTextFile.Close

Wscript.echo "Done!"

 

 

Posted by dhite | with no comments
Filed under:

Modifying SQL Queries To View More Than 255 Characters

 

SQL 7.0 and its predecessor SQL 2000 both have a default setting to return a maximum of 255 characters from any given column regardless of the Data Type applied to that column. SQL Server 2005 adds one to the mix by setting the default to 256 characters.

 

For SQL 7.0 and 2000 the maximum that you can set is 8,192 characters. For SQL 2005 the maximum that you can set is 65,535 characters for a grid and 8,192 characters for text as with SQL 2000.

 

For most SQL query results 255 characters is quite sufficient however you still may want to modify SQL’s behavior to view either more or less information. Use the steps below to change the maximum number of characters that you want returned to your result set.

 

To change this value for SQL Server 7.0 or SQL Server 2000 use the following steps:
 

  • From within the SQL Query Analyzer
  • Select “Tools”
  • Select “Options”
  • Select “Results”
  • Where it states "Maximum number of characters per column:" you can enter your new value and select “OK” to save the change


 
To change this value for SQL Server Management Studio use the following steps:
 

 

  • From within the SQL Server Management Studio
  • Select “Tools”
  • Select “Options”
  • Click the + sign to expand “Query Results”
  • Expand “SQL Server”
  • Select “Results to Text”
  • Where it states "Maximum number of characters displayed in each column:" you can enter your new value and select “OK” to save the change

 

Note: You can also click on “Reset To Default” to change the value back to 256 if needed.

 

Posted by dhite | with no comments

By Request SQL Query To Determine What Operating Systems SMS Supports

 

 The WMI class SMS_SupportedPlatforms is created and populated when you install SMS. It is “Read Only” in that you cannot add or remove from it.

 

The only way to add or remove from this class is when SMS itself modifies it. When a new Pdf is processed on the site systems and it contains a platform not found in the existing SMS_SupportedPlatforms table that information is added to the WMI class instance.

 

The query below can be executed from SQL 2000 or SQL 2005 with either SMS 2.0 or SMS 2003 installed.

 

 

 SQL Query:

 

 

Select

OsPlatform Architecture,

OsName 'Operating System',

DisplayText Version,

 

'OsMinVersion' = Case

When OsMinVersion = '0.00.0000.0' Then 'All Previous Versions'

Else OsMinVersion

End,

 

'OsMaxVersion' = Case

When OsMaxVersion = '99.99.9999.9999' Then 'All Future Versions'

Else OsMaxVersion

End

 

From SupportedPlatforms

Where OsMinVersion <> '0'

 

 

Posted by dhite | with no comments
Filed under: ,

By Request: Reader Requested Scripts and Queries

 

Since I began as a columnist writing for Rod Trent on SWYNK.Com now Enterpriseitplanet.Com in 1999 I have received E-Mail request and questions on a fairly regular basis from readers throughout the world.

 

In the past I have responded to each and every one of those E-Mails (And will continue to do so) if I could resolve their questions or not. For the most part I am pleased to say that I either addressed their questions or pointed them in the right direction to satisfy them. This was great both for the requestor and for myITforum readers in that many of my articles and post over the years are based on ideas taken for these E-Mails.

 

When Rod graciously provided me with my own place in space on myITforum’s blogs page I found that I could both write and post my articles, scripts and queries swiftly and instantaneously with a few clicks of the mouse. I soon began to realize that Blog pages are not much different than E-Mail in that they are both as close to real-time as I can get.

 

I have created a new category on my Blog page appropriately called “By Request” for reader requested scripts, queries and general questions . Here I will post some of my final responses to questions I have received from readers that I feel may benefit the myITforum community.

 

NOTE: Out of respect (and to maintain anomimity) for my readers I will not publish the E-Mail addresses or the identity of the requestors nor will I publish the E-Mail contents here.

 

If you would like to submit request for SQL, WQL, WMI or VBS scripts send me an E-Mail to DonHite@knoxy.Net and I will address your questions in a timely manner as time allows as I jot down notes thought the week and do a majority of my writing on the weekends.

 

There are also a number of resources that are provided by myITforum where you can also interact with the user community on almost any subject from Altiris to Windows and get resolution to your questions listed below:

 

MyITforum Home Page:

Http://Www.myITforum.Com

 

Forums:

Http://Www.myITforum.Com/Forums

 

E-Mail Discussion Lists:

Http://Www.myITforum.Com/Lists.Asp

 

Daily Newsletter:

Http://Www.myITforum.Com/Newsletter.Asp

 

 

Posted by dhite | with no comments
Filed under:

Computer Stupidities

Computer Stupidities

The Computer Stupidities page is where you can view "A large collection of stories and anecdotes about clueless computer users" by Topic including the following:

Systems, Hardware, Networks, Emergencies, Tech Support, Role Reversal and Others

Posted by dhite | with no comments
Filed under:

Write SMS Component Info To Excel VB Script

 

This Vbs script will prompt you for a machine name and in turn write the following SMS component information: Machine Name, Component, Version and State as it appears in the Control Panels ‘System Management’ applets ‘System Management properties’ components tab to a Microsoft Excel spreadsheet.

 

It will query the following components and return the Installed or Enabled state of each:

 

CCM Framework

CCM Policy Agent

CCM Status Agent

SMS Client Core Components

SMS Inventory Agent

SMS Remote Control Agent

SMS Shared Components

SMS Software Distribution Agent

SMS Software Metering Agent

SMS Software Update Agent

SMS Source List Update Agent

 

 

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

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

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

 

strComputer = InputBox("Enter Machine Name To Query")

Set oCPAppletMgr = CreateObject("CPApplet.CPAppletMgr", strComputer )

Set oClientComponents = oCPAppletMgr.GetClientComponents()

 

For Each oOption In oClientComponents

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

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

objExcel.Cells(intRow, 3).Value = oOption.Version

Select Case oOption.State

Case 0 objExcel.Cells(intRow, 4).Value = "Installed"

Case 1 objExcel.Cells(intRow, 4).Value = "Enabled"

Case 2 objExcel.Cells(intRow, 4).Value = "Disabled"

End Select

intRow = intRow + 1

Next

Set oClientComponents = Nothing

Set oCPAppletMgr = Nothing

 

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

objExcel.Selection.Interior.ColorIndex = 19

objExcel.Selection.Font.ColorIndex = 11

objExcel.Selection.Font.Bold = True

objExcel.Cells.EntireColumn.AutoFit

 

 

 

Posted by dhite | with no comments
Filed under:

SQL Server 2005 Management Studio Keyboard Shortcuts

 

Microsoft SQL server 2005 like its predecessors includes several keyboard shortcuts. Since SQL 2005 has many new features and a vast number of improvements as well several of the keyboard shortcuts have been change or replaced by the new enhancements.

 

Below you will find the most commonly used keyboard shortcuts found in the  SQL Server Management Studio.

 

Launch Query Analyzer           

+ R for Run and then SqlWb.exe to launch SQL Server Management Studio

 

Results in Grid 

Ctrl + D

 

Change database         

Ctrl + U

 

Results in Text 

Ctrl + T

 

Execute Query 

Ctrl + E or F5

 

Show/Hide Object browser     

F8 (Auto Hide has to be enabled)

 

New Query Window   

Ctrl + Q

 

New Query with New Connection       

Ctrl + N (Then selecting SQL Server Query template)

 

Open a .SQL Script file           

Ctrl + O

 

Full Screen      

Shift + Alt + Enter

 

Parse the query

Ctrl + F5

 

Show/Hide Results Pane          

Ctrl + R

 

Switch between query and results panes           

F6

 

Information about all the objects in the current database

Alt + F1

 

 

Posted by dhite | with no comments

Determining What Site Server Is Defined As Your Server Locator Point

 

Introduced in SMS 2003 the SMS Server Locator Point role was created to function much like an index in a book. You turn to the index in a book or manual to find a specific entry in the book. The same basic function is used here.

 

Server Locator Point (SLP) servers help your legacy clients find their Client Access Point (CAP) servers for site assignment or the Management Points (MP) for your Advanced Clients for automatic site assignment.

 

SLP’s are used for scripting SMS client installations either in Logon scripts, Visual basic scripts (VBS), Windows Management Instrumentation (WMI) scripts or batch files (Bat, Cmd).

 

You can use the following SQL script to find your sites designated SLP server for creating such client installation scripts as mentioned above.

 

NOTE: You can also change the line Where Role.System_Roles0 = to any of the following to find your sites other server roles if needed:

 

'SMS Client Access Point'

<