This VBS script will read a text file called MachineList.Txt and will write the Machine name, Network adapter name and Manufacturer name 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 = "Network Adapter"
objExcel.Cells(1, 3).Value = "Manufacturer"
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\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_NetworkAdapter Where NetConnectionStatus = '2'")
For Each objItem in colItems
objExcel.Cells(intRow, 1).Value = objItem.SystemName
objExcel.Cells(intRow, 2).Value = objItem.Name
objExcel.Cells(intRow, 3).Value = objItem.Manufacturer
intRow = intRow + 1
Next
objExcel.Range("A1:C1").Select
objExcel.Selection.Interior.ColorIndex = 19
objExcel.Selection.Font.ColorIndex = 11
objExcel.Selection.Font.Bold = True
objExcel.Cells.EntireColumn.AutoFit
loop
Wscript.Echo "Done"
This VBS Script will take a local or remote machine name from an input dialog box and will send the machine name, drive letter and disk type to an Excel spreadsheet.
strComputer = InputBox("Enter Server Name")
objExcel.Cells(1, 2).Value = "Device ID"
objExcel.Cells(1, 3).Value = "Drive Type"
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\Cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_LogicalDisk")
objExcel.Cells(intRow, 2).Value = objItem.DeviceID
Select Case objItem.DriveType
Case 0 DriveType = "Unknown"
Case 1 DriveType = "No Root Directory"
Case 2 DriveType = "Removable Disk"
Case 3 DriveType = "Local Disk Drive"
Case 4 DriveType = "Network Connection"
Case 5 DriveType = "CD-ROM Disc"
Case 6 DriveType = "RAM Drive"
Case Else DriveType = ""
End Select
objExcel.Cells(intRow, 3).Value = DriveType
MsgBox "Done"
This VBS script will allow you to hard code a directory folder name and when executed will send all of the files in the root directory folder and all the sub folders to an excel spreadsheet.
objStartFolder = "C:\MyFiles"
objExcel.Cells(1, 1).Value = "Folder"
objExcel.Cells(1, 2).Value = "File Name"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(objStartFolder)
Set colFiles = objFolder.Files
For Each objFile in colFiles
objExcel.Cells(intRow, 1).Value = objfolder.Name
objExcel.Cells(intRow, 2).Value = objFile.Name
ShowSubfolders objFSO.GetFolder(objStartFolder)
Sub ShowSubFolders(Folder)
For Each Subfolder in Folder.SubFolders
objExcel.Cells(intRow, 1).Value = Subfolder.Path
Set objFolder = objFSO.GetFolder(Subfolder.Path)
ShowSubFolders Subfolder
End Sub
objExcel.Range("A1:B1").Select
This SQL Query will provide you with a list of all of the IBM and Lenovo machines.
SQL Query:
Select
SD.Name0,
CS.Manufacturer0
From v_R_System SD
Join v_GS_Computer_System CS On SD.ResourceId = CS.ResourceId
Where CS.Manufacturer0 = 'IBM'
Or CS.Manufacturer0 = 'Lenovo'
Order By CS.Manufacturer0, SD.Name0
Provided here you will find two SQL queries to allow you to list all of the Views from a specified SQL Database.
The first query uses the Tables Schema and the second one uses the Views Schema.
SQL Query: Tables Schema
Table_Name
From Information_Schema.Tables
Where Table_Type = 'View'
Order By Table_Name
SQL Query: Views Schema
From Information_Schema.Views
When we say that someone was or are eves dropping it is meant to infer that they are listening in on a private conversation when they should not be.
This can be traced back to the age before the invention of the rain gutter where they used eves to carry rainwater away from their homes and other buildings. Eves were an extension of the roof and if someone was standing under the eves they could hear conversations in the home through an open window or through thin walls before insulation was invented. If they were in fact listening to the conversations inside the home they were eves dropping.
The Wikimedia Commons site is a Shared media repository site where you can grab pictures and images for your desktop wallpaper or photo screensaver royalty free.
Wikimedia Commons
http://commons.wikimedia.org
This HTA script will take a site server name and site code and list all of the available site system roles for the server and send the results 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>Site Server Roles</td>"
strHTML = strHTML & "</tr>"
strComputer = SiteServer.Value
strSiteCode = SiteCode.Value
Set objWMIService = GetObject("winmgmts://" & strComputer & "\root\sms\site_" & strSiteCode)
Set colItems = objWMIService.ExecQuery("Select * from SMS_SystemResourceList")
Window.Document.Title = "Site Server Roles For " & UCase(SiteServer.Value) & " (" & UCase(SiteCode.Value) & ")"
strHTML = strHTML & "<td width='1%'>" & objItem.RoleName & "</td>"
strHTML = strHTML & "</table>"
DataArea.InnerHTML = strHTML
</script><Body>
<p><h3 align = center><font color='Orange'>Please Visit myITforum.Com</font></h3>
<div></div>
Site Server: <Input Type = "Text" Name = "SiteServer">
Site Code: <Input Type = "Text" Name = "SiteCode">
<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>
BDPAdd is a tool that will bulk add protected branch distribution points to a ConfigMgr 2007 (SCCM) hierarchy. There is currently not a way, in the ConfigMgr console, to add multiple protected Branch distribution points at once. This tools attempts to address that problem.
Running the tool
BDPAdd.exe /s {central site server} /file {excel file} /log {path}
/s Central Site Server name.
/file Path to Excel files.
/log Log file path.
The input for this tool is an Excel 2003 spreadsheet and there are some requirements for the format of this spreadsheet. Review the example spreadsheet, bdpexample.xls, attached. Any deviation from this will either produce errors or unexpected results.
All output from this tool is written to the log file only. (The Trace utility from the ConfigMgr toolkit can be used to view the log)
BDPAdd 1.0 http://www.codeplex.com/bdpadd/Release/ProjectReleases.aspx?ReleaseId=14111
Additional Information
http://www.codeplex.com/bdpadd
This VBS script was written as an example of how to replace the results from a WMI string results set to remove unwanted characters.
The BootDirectory value of \WINDOWS has the \ removed or trimmed from it and the Caption has the \Device\Harddisk0\Partition removed.
strComputer = "LocalHost"
Set colItems = objWMIService.ExecQuery("Select * from Win32_BootConfiguration")
strBootDirectory = Replace(objItem.BootDirectory, "\", "")
MsgBox "Boot Directory: " & strBootDirectory
strDisk = Replace(objItem.Caption, "\Device\Harddisk0\Partition", "")
MsgBox "Partition: " & strDisk
What kind of hairstyles would Leonardo Decaprio, Harry Potter, Jim Carrey, Bill Gates, Bruce Willis, George Clooney, Jay Leno, George Foreman, Ashton Kutcher, Ben Affleck, Sean Penn, Mat Damon, Orlando Bloom and Nicolas Cage have if they were women?
Celebrity Hairstyles - If They Were Women
http://world-haircuts.blogspot.com/2008/04/celebrity-hairstyles-if-they-were-women.html
Welcome aboard! You are one of our most valued new employees. Enclosed please find some helpful guidelines to company policy.
Overtime
The Company has an optional overtime policy - you have the option of working forty hours of overtime or eighty hours of overtime.
Promotion
The Company rewards hard work and devotion. We like to think that if you work hard and devote enough time and energy to the company, you will be rewarded by being allowed to train the CEO's son when he is promoted to Vice President over you.
Stock Options
You may buy shares in the company when it goes public. So named because you'll be working in the stock room at Wal-Mart when the company goes belly-up due to your incompetence.
401k
This is how much money you'll lose under your "Stock Option" plan.
Hellth Plan
No, that isn't a misprint; you now belong to an H.M.O. That stands for "Hell's Medical Organization." It was organized by some of Hell's finest minds: Hitler, Genghis Khan, and Josef Stalin worked night and day to create a 162-page manual documenting the exact terms of your coverage, but it all boils down to three points:
1. You belong to the HMO. We mean that literally - as of now, the HMO owns you. To insure that you don't forget your subscriber number, we will tattoo it to your forehead.
2. You have been assigned a primary care physician. You will not be told your physician's name. You may never see your physician. Your physician is imaginary. If you see any doctor without express written permission of your imaginary primary care physician, you will be forced to pay full price, plus eat your weight in lard.
3, You are not covered under this plan.
Termination
All employees will be given two weeks notice upon being fired. We like to feel that this gives an employee a "grace period" to steal all of the office supplies that he or she may have forgotten to take during his or her period of employment.
Complaints
May be made anonymously in the box marked "Complaints" in the employee break room. All complaints will be reviewed, processed, and fed to an angry Rottweiler named Frankie.
Thanks Chad W.
This VBS script will allow you to enter a remote machine name into an input dialog box and will in turn list the services on that machine with their current state marked Green (Running) or Red (Stopped) as appropriate to a web page.
strComputer = InputBox ("Enter Machine Name")
Set objExplorer = WScript.CreateObject("InternetExplorer.Application")
objExplorer.Navigate "About:Blank"
objExplorer.Document.Title = "Created By Don Hite For myITforum.Com"
objExplorer.ToolBar = 0
objExplorer.StatusBar = 0
objExplorer.Visible = 1
strHTML = strHTML & "<td width='10%' bgcolor = 'SeaShell'><font color = 'Blue'><b>Name</td>"
strHTML = strHTML & "<td width='10%' bgcolor = 'SeaShell'><font color = 'Blue'><b>Display Name</td>"
strHTML = strHTML & "<td width='10%' bgcolor = 'SeaShell'><font color = 'Blue'><b>Start Mode</td>"
strHTML = strHTML & "<td width='10%' bgcolor = 'SeaShell'><font color = 'Blue'><b>State</td>"
Set colItems = objWMIService.ExecQuery ("Select * From Win32_Service")
strHTML = strHTML & "<td width='10%'>" & objItem.Name & "</td>"
strHTML = strHTML & "<td width='10%'>" & objItem.DisplayName & "</td>"
strHTML = strHTML & "<td width='10%'>" & objItem.StartMode & "</td>"
If objItem.State = "Running" Then
strHTML = strHTML & "<td width='10%'><Font Color='Green'>" & objItem.State & "</Font></td>"
ElseIf objItem.State = "Stopped" Then
strHTML = strHTML & "<td width='10%'><Font Color='Red'>" & objItem.State & "</Font></td>"
End If
strHTML = strHTML & "<p align='center'> <font color='Blue'>Please Visit myITforum.Com</p>"
objExplorer.Document.Body.BgColor = "CornSilk"
objExplorer.Document.FgColor = "SaddleBrown"
objExplorer.Document.Body.InnerHTML = strHTML
This VBS script will allow you to find all client machines that have a specified product installed. And will send the results to an excel spreadsheet.
strProductName Examples:
Microsoft .NET Framework 3.0
%NET Framework 3%
strServer = InputBox ("Site Server Name")
strDatabase = InputBox ("Site Code")
strProductName = InputBox ("Product Name")
objExcel.Cells(1, 2).Value = "User Name"
objExcel.Cells(1, 3).Value = "Product Name"
objExcel.Cells(1, 4).Value = "Product Version"
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, SD.User_Name0, SP.ProductName, SP.ProductVersion" & _
" From vSMS_G_System_SoftwareProduct SP" & _
" Join System_Disc SD on SD.ItemKey = SP.ClientId" & _
" Where SP.ProductName = '" & strProductName & "' " _
, 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("User_Name0").Value
objExcel.Cells(intRow, 3).Value = objRecordSet.Fields("ProductName").Value
objExcel.Cells(intRow, 4).Value = objRecordSet.Fields("ProductVersion").Value
objRecordSet.MoveNext
Loop
objExcel.Range("A1:D1").Select
Set objSheet = objExcel.ActiveWorkbook.Worksheets(1)
Set objRange = objExcel.Range("A1")
objRange.Sort objRange,1,,,,,,1
This VBS script will allow you to enter a Domain Controller (DC) Server name or a remote workstation name to list the SIDS
DnsAdmins
S-1-5-21-1808774407-1002908778-2105408048-1101
Local
LabServer
Domain
LabDomain
strComputer = InputBox ("Enter Server Name")
objExcel.Cells(1, 1).Value = "Name"
objExcel.Cells(1, 2).Value = "SID"
objExcel.Cells(1, 3).Value = "Type"
objExcel.Cells(1, 4).Value = "Domain"
Set colItems = objWMIService.ExecQuery("Select * from Win32_Account")
objExcel.Cells(intRow, 1).Value = objItem.Name
objExcel.Cells(intRow, 2).Value = objItem.SID
If objItem.LocalAccount = TRUE Then
objExcel.Cells(intRow, 3).Value = "Local"
ElseIf objItem.LocalAccount = FALSE Then
objExcel.Cells(intRow, 3).Value = "Domain"
objExcel.Cells(intRow, 4).Value = objItem.Domain