This VBS script will allow you to enter a remote machine name from an input dialog box and will retrieve system information for the specified machine.
The information captured will be the machines: Manufacturer, Model, Domain Type, Total Physical Memory, Processor Manufacturer, Processor Name, Processor Clock Speed, Bios Version, Serial Number, Video Controller, CD-ROM Manufacturer, CD-ROM Name, KeyBoard and the Primary Drive Size
VBS Script:
strComputer = InputBox ("Enter Machine Name")
Const NUMBER_OF_ROWS = 15
Const NUMBER_OF_COLUMNS = 2
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
Set objDoc = objWord.Documents.Add()
Set objRange = objDoc.Range()
objDoc.Tables.Add objRange, NUMBER_OF_ROWS, NUMBER_OF_COLUMNS
Set objTable = objDoc.Tables(1)
objTable.Cell(1,1).Range.Text = "System Information For: "
objTable.Cell(2,1).Range.Text = "Manufacturer"
objTable.Cell(3,1).Range.Text = "Model"
objTable.Cell(4,1).Range.Text = "Domain Type"
objTable.Cell(5,1).Range.Text = "Total Physical Memory"
objTable.Cell(6,1).Range.Text = "Processor Manufacturer"
objTable.Cell(7,1).Range.Text = "Processor Name"
objTable.Cell(8,1).Range.Text = "Processor Clock Speed"
objTable.Cell(9,1).Range.Text = "Bios Version"
objTable.Cell(10,1).Range.Text = "Serial Number"
objTable.Cell(11,1).Range.Text = "Video Controller"
objTable.Cell(12,1).Range.Text = "CD-ROM Manufacturer"
objTable.Cell(13,1).Range.Text = "CD-ROM Name"
objTable.Cell(14,1).Range.Text = "KeyBoard"
objTable.Cell(15,1).Range.Text = "Primary Drive Size"
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_ComputerSystem")
For Each objItem in colItems
objTable.Rows.Add()
objTable.Cell(1, 2).Range.Text = UCase(strComputer)
objTable.Cell(2, 2).Range.Text = objItem.Manufacturer
objTable.Cell(3, 2).Range.Text = objItem.Model
Select Case objItem.DomainRole
Case 0 strComputerRole = "Standalone Workstation"
Case 1 strComputerRole = "Member Workstation"
Case 2 strComputerRole = "Standalone Server"
Case 3 strComputerRole = "Member Server"
Case 4 strComputerRole = "Backup Domain Controller"
Case 5 strComputerRole = "Primary Domain Controller"
End Select
objTable.Cell(4, 2).Range.Text = strComputerRole
objTable.Cell(5, 2).Range.Text = objItem.TotalPhysicalMemory/1048576 & " MB"
Next
Set colItems = objWMIService.ExecQuery("Select * from Win32_Processor")
objTable.Cell(6, 2).Range.Text = objItem.Manufacturer
objTable.Cell(7, 2).Range.Text = objItem.Name
objTable.Cell(8, 2).Range.Text = Round(objItem.MaxClockSpeed) & " MHz"
Set colItems = objWMIService.ExecQuery("Select * from Win32_BIOS")
objTable.Cell(9, 2).Range.Text = objItem.Version
objTable.Cell(10, 2).Range.Text = objItem.SerialNumber
Set colItems = objWMIService.ExecQuery("Select * from Win32_VideoController")
objTable.Cell(11, 2).Range.Text = objItem.Name
Set colItems = objWMIService.ExecQuery("Select * from Win32_CDROMDrive")
objTable.Cell(12, 2).Range.Text = objItem.Manufacturer
objTable.Cell(13, 2).Range.Text = objItem.Name
Set colItems = objWMIService.ExecQuery("Select * from Win32_Keyboard")
objTable.Cell(14, 2).Range.Text = objItem.Caption
Set colItems = objWMIService.ExecQuery("Select * from Win32_LogicalDisk Where DeviceID = ""C:""")
objTable.Cell(15, 2).Range.Text = Round(objItem.Size /1073741824) & " GB"
objTable.AutoFormat(23)
Here you will find a Vbs script to use to install the ConfigMgr 2007 client on a machine via a System Startup script via a Group Policy or in conjunction with your domain logon scripts.
strComputer = "."
strService = "CcmExec"
Set colServices = objWMIService.ExecQuery("Select * from Win32_Service Where Name='" & strService & "'")
If colServices.Count = 1 Then
Set WshShell = WScript.CreateObject("WScript.Shell")
strSiteServer = "SiteServerName"
strSiteCode = "XXX"
strCommand = "\\" & strSiteServer & "\SMS_" & strSiteCode & "\Client\CcmSetup.exe /mp:" & strSiteServer & " SmsSiteCode=" & strSiteCode
WshShell.Run(strCommand)
Else
Wscript.Quit
End If
VBS Script To Install The Configuration Manager 2007 Client On A Local Machine
http://myitforum.com/cs2/blogs/dhite/archive/2007/10/21/vbs-script-to-install-the-configuration-manager-2007-client-on-a-local-machine.aspx
How to use Group Policy to remotely install software in Windows Server 2003
http://support.microsoft.com/kb/816102
This Vbs script will allow for you to browse for a directory folder and then it will send all of the file contents to an excel spreadsheet sorted alphabetically. This script can be used to gather and print a list of the music or video files you have in a particular location at home. At work or at the office it can be useful for listing the contents of a particular SMS inbox or simply to print a directory folders contents.
This script was originally intended as a lazy way for me to print a directory folders contents. In the past I use to issue a Dir command from the directory folder and pipe it out to a text file. Then I had to edit the file to remove all but the Filename. Finally I was able to print the text file for my records. In essence just think of it as an easy way to print a directory folders contents.
Note: This script will not enumerate any subfolders under the directory folder selected. That is a script for another day.
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.BrowseForFolder (0, "Select The Folder To Enumerate :", (0))
If objFolder Is Nothing Then
Set objFolderItem = objFolder.Self
objPath = objFolderItem.Path
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
objExcel.Workbooks.Add
intRow = 2
objExcel.Cells(1, 1).Value = "File Name"
Set objFso = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFso.GetFolder(objPath)
For each objFile in objFolder.Files
If objFolder.Files.Count > 0 Then
objExcel.Cells(intRow, 1).Value = objFile.Name
intRow = intRow + 1
objExcel.Range("A1").Select
objExcel.Selection.Interior.ColorIndex = 19
objExcel.Selection.Font.ColorIndex = 11
objExcel.Selection.Font.Bold = True
objExcel.Cells.EntireColumn.AutoFit
Set objSheet = objExcel.ActiveWorkbook.Worksheets(1)
Set objRange = objExcel.Range("A1")
objRange.Sort objRange,1,,,,,,1
MsgBox "Done"
Use the SQL script below to list all the SMS resources found on a specified subnet.
SQL Query:
Select
Netbios_Name0 'Machine Name',
IP_Addresses0 'Last IP Address'
From System_IP_Address_ARR
Join System_Disc MachineName
on System_IP_Address_ARR.ItemKey = MachineName.ItemKey
Where IP_Addresses0 Like '192.168.1.%'
And Netbios_Name0 is not Null
Order by Name0 Asc
Use this SQL server script from the SQL query window to rename an existing database. The script below will place the database in single user mode then rename the device and put then new device name back into multi user mode for use.
SQL Script:
Use Master
Go
Sp_DbOption <Current_Database>, 'Single User', True
Exec Sp_ReNameDb '<Current_Database_Name>', '<New_Database_Name>'
Sp_DbOption <New_Database_Name>, 'Single User', False
Note: You must restart or refresh the Query Analyzer to view the name change
Here you will find a trick to use that will allow you to export a specified SMS web report to a file name and location of your choosing from the Web Reporting page on your local workstation.
Say you are executing the SMS Web Report “Count Clients assigned and installed for each site” and you want to save the results as a CSV or even as a text file. You can do so by selecting “Export” from the menu bar or you can add the following to the end of the URL for the report:
&ExportTo=C:\YourFileName.Csv
Example:
Http://SmsServerName/SmsReporting_XXX/Report.asp?ReportId=103&ExportTo=C:\YourFileName.Csv.
Note: It is important to note here that the C:\ drive specified will not be the C:\ drive on the Workstation or server that web report is run from but will be the C:\ drive of the specified SmsServerName in the URL. You can however redirect the URL to use a UNC path to an existing file share as in the following:
&ExportTo=\\ServerName\ShareName\YourFileName.Csv
Http://SmsServerName/SmsReporting_XXX/Report.asp?ReportId=103&ExportTo=\\ServerName\ShareName\YourFileName.Csv
Tip: The above can also be used for ConfigMgr 2007 as well as SMS 2003.
This means of saving a report is not any faster or simpler than choosing Export and browsing for a place to save the report file however from a scripting aspect it can be used in a number of ways.
For example you can create a VBS or PowerShell script to allow you to export those web reports that you use quite often without having to memorize the Report ID for the report. You can also use the redirect syntax as a scheduled task to run after hours or at a specified interval so that the report will be waiting for you when you need it.
Note: This information is based on the pre-release version of Windows Server 2008 and is subject to change.
Processor
Minimum: 1 GHz (for x86 processors) or 1.4 GHz (for x64 processors)
Recommended: 2 GHz or faster
An Intel Itanium 2 processor is required for Windows Server 2008 for Itanium-Based Systems.
Memory
Minimum: 512 MB
Recommended: 2 GB or more
Maximum (32-bit systems): 4 GB (for Windows Server 2008 Standard) or 64 GB (for Windows Server 2008 Enterprise or Windows Server 2008 Datacenter)
Maximum (64-bit systems): 32 GB (for Windows Server 2008 Standard) or 2 TB (for Windows Server 2008 Enterprise, Windows Server 2008 Datacenter, or Windows Server 2008 for Itanium-Based Systems)
Disk Space
Minimum: 10 GB
Recommended: 40 GB or more
Additional Requirements
DVD-ROM drive
Super VGA (800 x 600) or higher-resolution monitor
Keyboard and Microsoft® mouse (or other compatible pointing device)
After you have successfully installed Microsoft System Essentials (SCE) 2007 the install opens to the SCE Overview page where you are presented with the Essential Configuration Incomplete page. Here you will find a list of tasks that must be completed.
The first task required is the “Configure Product Features” where you will be once again guided by a wizard to configure your SCE server. Follow the steps below to compete this task.
1. Click on the “Required: Configure Product Features” and select “Next” to continue with the wizard.
2. The Proxy Server task appears where you can select whether or not to “use a proxy server when connecting t the internet”. The default is NO but you can set it to use a proxy sever by selecting the “Yes” radio button. Then enter the Proxy “Server name” and “Port number”. If you wan to specify an account other than default account select the box to “Use the following credentials to connect to the proxy server:” and supply the “User name”, “Password” and the “Domain”. Then click “Next” to continue the wizard.
3. Next the Policy Type task appears where you can select to choose the policy type to use. If you are installing SCE as a user with Domain Administrative privileges choose the default option of “Yes, configure a domain-level Group Policy for me (recommended)” When this option is selected all the machines running SEC 2007 components (or agents) are automatically configured. If you are not installing SCE with an account that has Domain Administrative privileges select “No, use local policy to configure computers.” Then click “Next” to continue.
4. Next the Firewall Exceptions task appears where you can choose how SCE will use firewall exceptions. Select the default of “Yes, create Windows Firewall exceptions (recommended)”. If you select “No, do not create Windows Firewall exceptions” SCE will not be able to remotely install agents on your domain machines if their firewall is enabled and the exceptions are not configured. Then select “Next” to continue.
SCE incoming communication ports are listed below:
TCP: 135. 139 and 445
UDP: 137 and 138
5. Next the Configure Remote Assistance task appears where you can select whether or not you want to enable and use remote assistance for your agent resources. When you have made your selection click “Next” to continue.
6. Next the Error Monitoring task appears where you can select whether or not to collect application errors on your managed machines. It is recommended to select the default of “Yes, collect application errors (recommended)”. Then enter the location of the error reports uploads to the SCE server. It is best to specify a location other than the operating system partition. You can also specify the port number to use when clients submit errors or accept the default of port number 51906. When completed select “Next” to continue.
7. Next the Configure Error Forwarding task appears. Here you can chose whether or not to “Automatically forward all collected errors to Microsoft”. When completed select “Next” to continue.
8. Next the Daily Health Report task appears. Here you can choose whether or not to receive a daily health report sent to a specified E-Mail address. You can change the default port number of 25 if needs and can allow an anonymous authentication mode or a Windows Integrated one. To use this feature enter the “Recipient Address”, “SMTP Server” name, “Port”, “Authentication mode”, and select a time to send the report the default is 7:00 AM. The click “Test” to test the configuration and then click “Next” to continue.
9. Next the Scheduled Discovery task appears. Here you can specify whether or not you want to have SCE use Active Directory (AD) to automatically discover and manage all of the computers in your domain. If you choose “Yes, automatically discover and manage all computers in my domain” set the “Run discovery daily at:” time interval. Make your choice and then select “Next” to continue.
10. Next select “Configure” and the Feature Configuration is in progress task is executed and checks your selected setup options. Then the Policy Configuration Results screens opens with pass or fail checks shown for each of the options. Click to “Close” to compete the Required: Configure Product Features and you will be returned to the Overview task list.
11. Next select the “Required: Configure Computers and devices to manage” task to configure the resource management tasks.
12. The Introduction task appears and select “Next” to continue with the wizard.
13. Next the Auto or Advanced task appears where you can select to “Automatic computer discovery” or “Advanced discovery”. Make your choice and select “Next” to continue.
Note: If you select the “Advanced discovery” option you can choose any of the following: Servers & Clients, Servers Only, Clients Only or Network Devices.
14. Next the Administrator Account task appears where you can choose to either use the Management Server Action account or specify another account to use to perform the scans and to install the agents. Make your selection and then select “Discover” to begin the process.
The Discovery Progress task is performed and will scan AD for computers and network devices to manage.
15. When the Discovery Progress task has completed the Select Objects to Manage task appears when you “Select the devices you ant to manage.” Select the discovered resources you want to manage and then select “Next” to continue .and at the summary task click “Finish” to begin the Agent Management Task. Here you can wait for the process to complete or select “Close” to return to the Overview page.
Note: Closing the window will not interrupt the task and you can go back at a later time and check the status of the task in the task status view,
16. Next from the Overview page select “Required: Configure Microsoft Update Settings” to begin the task. Click “Next” at the Introduction page to continue.
17. Next the Proxy Server task will appear where you can specify if a proxy server is needed for the updates. Make you selection and change the “Server name”, “Port Number” and the “User Name”, “Password” and “Domain” information if needed. When you are finished select “Synchronize” and the Synchronization Process task will be performed. When the task has completed the Products task will appear where you can select “Yes” to download updates for operating systems only or select “No, I will choose products from the list below”. Make your selection and then select “Next” to continue.
18. Next the Classifications task will appear here select “Yes (Recommended)” and then select “Next” to continue.
19. Next the Auto Approvals task appears where you can select “Yes. Approve these updates immediately after they re synchronized” which is recommended or you can select “No, I will manually approve all updates”. Make your selection and click “Next” to continue.
20. Next the Synchronization task appears where you can select to “Synchronize Manually” or “Synchronize daily at:” which is the default set to synchronize at 3:30:00 AM each night.
21. Finally the Summary task appears where you select “Synchronize updates when this wizard closes. Click “Finish” to complete the wizard and have SCE perform its synchronization.
This PowerShell script will allow you to enter a remote machine name and will return the machine name and currently logged on user name and write the results to the active window.
PS1 Script:
$strComputer = "."
$Var =GWMI -Comp $strComputer -CL Win32_ComputerSystem
"Machine Name: " + $Var.Name + " User Name: " + $Var.UserName
In the good old days of fairs, carnivals and the traveling circus many of the games of chance and skill found there were played for gifts or prizes. One of the more popular prizes for the gentlemen was cigars. When a man played a game of skill such as shooting moving ducks or tossing a ring around an item in hopes of wining it for tier bride and they missed or lost the barker would often say “Close, but no cigar”
Today the term is still used and is meant to imply that you missed a reward or you received nothing for your efforts.
Here you will find information on how to create a Custom MMC snap-in to access your OpsMgr Web console form your workstation.
Unfortunately System Center Operations Manager (OpsMgr) 2007 is not available as an exposed Snap-in to the Microsoft Management Console (MMC) and as a result you cannot add the Operations Console to your custom MMC. However you can still access the ConfigMrg Web Console in your custom MMC.
Follow the steps below to create a custom MMC for the OpsMgr 2007 Web Console
1. From the run command enter the following: Mmc /A to start the MMC in author mode
2. Once the MMC is open from the menu bar select “File” and then select “Add/Remove Snap-In”
3. From the bottom of the screen select “Add..” and then from the Add Standalone Snap-in dialog box scroll down and select “Link to Web Address” and then select “Add”
4. From the Welcome to the Link to Web Address Wizard dialog box enter your Web Console URL such as http://OpsMgrServer:PortNumber/Default.aspx
And then select “Next” to continue.
5. From the Link to Web Address dialog box enter a “Friendly name for the Link to Web Address snap-in:” such as “OpsMgr Web Console” and then select “Finish” to complete the task.
6. At this point you will be returned to the Add Standalone Snap-in dialog box where you can repeat steps 1-5 above to enter another Web Console URL if needed by selecting “Add”. Otherwise click “Close”
7. From the Add/Remove Snap-in dialog box select “OK” when you are done and test the URL to ensure that it functions as expected.
8. Finally from the menu bar select “File” and then select “Save As” and change the “File name:” as needed as well as the “Save in:” as needed and then select “Save” and the select “File” and then “Exit”.
The Paessler WMI Tester allows you to “either see a result table showing the processes running on the machine or, in the event something went wrong, an error message.” This tool can be used to verify if WMI is operating as expected on a remote machine.
Paessler WMI Tester
http://www.paessler.com/download/freeware/paessler_wmi_tester
Other noteworthy Paessler tools from their Free Networking Tools section:
Paessler SNMP Tester
http://www.paessler.com/download/freeware/snmptester
Paessler MIB Importer and Converter
http://www.paessler.com/download/freeware/mibimporter
The Idevfactory SharePoint Environment (Farm) Reporting Utility is a great tool for gathering MOSS Farm environment statistics.
“The SharePoint Environment (Farm) Reporting feature aggregates statistics from across your SharePoint environment and delivers true environment sizing and statistical reports to help you understand your SharePoint Landscape.”
Additional information and screen prints:
http://www.idevfactory.com/products/uspm2007/features/sharepoint%20reporting%20farm.aspx
Null Values in SQL server are often confused with Empty or even 0 values but they are in fact Unknown values. This basically means that the values in the Database table’s column cannot be populated appropriately. The information cannot be written because SQL does not know what to write for the requested table’s column value. Since it doesn’t know what to write it cannot insert it appropriately and so it writes NULL as the value. So in essence the value is not empty it is NULL or it can be thought of as a Non value or an unknown value. So in the end as you can see it is not an empty or blank value it is in fact a NULL (Unknown) value that cannot be determined.
Tip: Many years ago (And many SQL versions ago) I leaned to think of Null values as great big question marks and this logic may work for you as well.
Null values can also be values that are not applicable. Take the SMS or ConfigMgr 2007 database for example. You have just completed a network discovery and found several potential client resources. However for one reason or other the client software cannot be installed on some of the detected resources. This may be because they have insufficient disk space or the Domain administrator’s global group was not found in the machines local administrator’s group however since the resource(s) were discovered some of the resources information can be written to the SQL database and some cannot.
For example the Client Version (Client_Version0) for the resource cannot be written as a legitimate value because it is not applicable. This is simply because the client software is not installed and the resource therefore does not have a client version. However as mentioned above some of the information can be written to the database for the discovered resource such as the machine name.
When querying or looking for Unknown or Null values using a Where clause in your SQL query you specify it as in the example below:
Name0
From V_R_System
Where Client_Version0 Is NULL
If you want to find the opposite or the legitimate values add the NOT keyword as in the example here:
Where Client_Version0 Is Not NULL
This HTA script will allow you to enter a Domain Controller (DC) Server name into an input box and will enumerate all of the Groups for that server 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
strHTML = "<table border='1' style='border-collapse: collapse' bordercolor='SaddleBrown' id='Table1' >"
strHTML = strHTML & "<tr>"
strHTML = strHTML & "<td width='10%' bgcolor = 'SeaShell'><font color = 'Blue'><b>Group Name</td>"
strHTML = strHTML & "</tr>"
strComputer = MachineName.Value
Set objComputer = GetObject("WinNT://" & strComputer)
objComputer.Filter=Array("group")
For Each group In objComputer
Window.Document.Title = "Group Names For: " & UCase(strComputer)
strHTML = strHTML & "<td width='1%'>" & group.Name & "</td>"
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>
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">