This VBS Script will send the following information for a specified machine name to excel: Machine Name, User Name, Operating System, Build Version, Manufacturer and Model.
VBS Script:
strComputer = InputBox ("Enter Machine Name")
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
objExcel.Workbooks.Add
objExcel.Cells(1, 1).Value = "Machine Name"
objExcel.Cells(2, 1).Value = "User Name"
objExcel.Cells(3, 1).Value = "Operating System"
objExcel.Cells(4, 1).Value = "Build Version"
objExcel.Cells(5, 1).Value = "Manufacturer"
objExcel.Cells(6, 1).Value = "Model"
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
For Each objItem in colItems
objExcel.Cells(1, 2).Value = objItem.CSName
objExcel.Cells(3, 2).Value = objItem.Manufacturer
objExcel.Cells(4, 2).Value = objItem.Version & Space(1) & objItem.CSDVersion & " Build " & objItem.BuildNumber
objExcel.Cells(3, 2).Value = objItem.Caption
Next
Set colItems = objWMIService.ExecQuery("Select * from Win32_ComputerSystem")
objExcel.Cells(2, 2).Value = objItem.UserName
objExcel.Cells(5, 2).Value = objItem.Manufacturer
objExcel.Cells(6, 2).Value = objItem.Model
objExcel.Range("A1:A6").Select
objExcel.Selection.Font.ColorIndex = 11
objExcel.Selection.Font.Bold = True
objExcel.Cells.EntireColumn.AutoFit
MsgBox "Done"
This VBS script will retrieve machine names and their corresponding Media Access Control (MAC) addresses and send the results to an excel spreadsheet.
strServer = InputBox ("Enter Site Server Name")
strDatabase = InputBox ("Enter Three Letter Site Code")
intRow = 2
objExcel.Cells(1, 2).Value = "MAC Address"
Const adOpenStatic = 3
Const adLockOptimistic = 3
Set objConnection = CreateObject("ADODB.Connection")
objConnection.Open "Provider=SQLOLEDB;Data Source =" & strServer & ";" & _
"Trusted_Connection=Yes;Initial Catalog =SMS_" & strDatabase
Set objRecordSet = CreateObject("ADODB.Recordset")
objRecordSet.Open _
" Select SD.Name0,MAC.MAC_Addresses0" & _
" From v_R_System SD" & _
" Join v_RA_System_MacAddresses MAC On SD.ResourceID = MAC.ResourceID" _
, objConnection, adOpenStatic, adLockOptimistic
objRecordSet.MoveFirst
Do Until objRecordSet.EOF
objExcel.Cells(intRow, 1).Value = objRecordSet.Fields("Name0").Value
objExcel.Cells(intRow, 2).Value = objRecordSet.Fields("MAC_Addresses0").Value
objRecordSet.MoveNext
intRow = intRow + 1
Loop
objExcel.Range("A1:B1").Select
Set objSheet = objExcel.ActiveWorkbook.Worksheets(1)
Set objRange = objExcel.Range("A1")
objRange.Sort objRange,1,,,,,,1
This VBS script will read a text file called MachineList.Txt and will write battery information for each of the resources to an Excel spreadsheet.
objExcel.Cells(1, 1).Value = "System Name"
objExcel.Cells(1, 2).Value = "Device ID"
objExcel.Cells(1, 3).Value = "Name"
Set Fso = CreateObject("Scripting.FileSystemObject")
Set InputFile = fso.OpenTextFile("MachineList.Txt")
Do While Not (InputFile.atEndOfStream)
strComputer = InputFile.ReadLine
Set colItems = objWMIService.ExecQuery("Select * from Win32_Battery")
objExcel.Cells(intRow, 1).Value = objItem.SystemName
objExcel.Cells(intRow, 2).Value = objItem.DeviceID
objExcel.Cells(intRow, 3).Value = objItem.Name
objExcel.Range("A1:C1").Select
objExcel.Selection.Interior.ColorIndex = 19
This VBS script will read a text file called MachineList.Txt and will write BIOS information for each of the machines to an Excel spreadsheet.
objExcel.Cells(1, 2).Value = "Manufacturer"
objExcel.Cells(1, 3).Value = "Serial Number"
objExcel.Cells(1, 4).Value = "Version"
Set colItems = objWMIService.ExecQuery("Select * from Win32_BIOS")
objExcel.Cells(intRow, 1).Value = UCase(strComputer)
objExcel.Cells(intRow, 2).Value = objItem.Manufacturer
objExcel.Cells(intRow, 3).Value = objItem.SerialNumber
objExcel.Cells(intRow, 4).Value = objItem.SMBIOSBIOSVersion
objExcel.Range("A1:D1").Select
This VBS Script will delete files in a specified directory folder that are older than 8 hours.
strFolder = "C:\Folder Name"
Set Directory = Fso.GetFolder(strFolder)
Set Files = Directory.Files
For Each Modified in Files
If DateDiff("H", Modified.DateLastModified, Now) > 8 Then Modified.Delete
This SQL query will display the count for resources installed on a site.
SQL Query:
Select Count(SS.ResourceID) Resources,
Sc.SiteCode 'Site Code'
From v_RA_System_SMSInstalledSites SS
Join v_Site SC On SS.SMS_Installed_Sites0 = SC.SiteCode
Group by Sc.SiteCode
Order By Resources
This SQL Query will list all of the machine resources that do not have an SMS Unique Identifier or GUID.
Select
SD.Name0 'Machine Name'
From System_Disc SD
Join MachineIdGroupXRef ID
On SD.ItemKey = ID.MachineID
And IsNull (SD.Sms_Unique_Identifier0, '')
<> ISNULL(ID.Guid, '')
The terms Bigwig, Big Wig or Big Wigs has its origins in 17th century France but was not popularized until it reached England in the 18th century. English nobles and others of importance such as priest, judges and lawyers wore wigs as did other professionals. The rich had more to spend on their wigs than those less fortunate. As a result their wigs contained more material and were taller or bigger hence the term Big Wig(s) came to be used to describe people of importance, wealth or those in charge.
Royal TS freeware is an alternative for the standard Terminal Services Snap-In that adds additional features, including connection specific display settings, stored login credentials and more. It allows you to connect to any server which supports RDP protocol, and the connections can be organized in custom categories for quick access. Additional features include console connections (Windows XP/2003 or later), custom RDP target port, display smart sizing, port redirection and more.
Overview:
http://www.code4ward.net/main/RoyalTS/Overview.aspx
Screen Shots:
http://www.code4ward.net/main/RoyalTS/Screenshots.aspx
Download:
http://www.code4ward.net/main/RoyalTS/Download.aspx
Provided here is a table containing the SQL logical operations with a brief description of each.
Operator
Description
=
Equal to
!= or <>
Not equal to
>
Greater than
>=
Greater than or equal to
<
Less than
<=
Less than or equal to
In
Equal to any item in a list
Not in
Not equal to any item in a list
Between
Between two values
Not between
Not between two values
Begins with
Begins with specified value
Contains
Contains specified value
Not contains
Does not contain specified value
Is null
Is blank
Is not null
Is not blank
Like
Like a specified pattern.
Not like
Not like a specified pattern.
.
The table below will briefly describe the Desired Configuration Monitoring (DCM) log files and their purposes.
Log File
DcmAgent
Provides information about assigned configuration baselines evaluations and desired configuration management processes.
CiAgent
Provides information about downloading, storing, and accessing assigned configuration baselines.
SdmAgent
Provides information about downloading, storing, and accessing configuration item content.
SdmDiscAgent
Provides high-level information about the evaluation process for objects and settings configured in the referenced configuration items.
Discovery
Provides detailed information about the Service Modeling Language (SML) processes.
This By Request VBS script is provided as an example of how to query the user(s) logged onto a remote terminal server.
strComputer = InputBox("Enter Terminal Server Name")
Set objShell = CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
strCommand = "Query User /Server:" & strComputer
objShell.Run("%Comspec% /K ") & strCommand,1,True
Good Things About Husbands:
Good Things About Horses:
Paint Like Jackson Pollock
http://www.jacksonpollock.org
Monte Python's Silly Walks Generator
http://www.sillywalksgenerator.com