This VBS Script will send all of the NT or Active Directory (AD) domain user names to excel.
VBS Script:
strDomain = InputBox ("Enter Domain Name Or Machine Name")
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
objExcel.Workbooks.Add
intRow = 2
objExcel.Cells(1, 1).Value = "Domain Name"
objExcel.Cells(1, 2).Value = "User Name"
Set colAccounts = GetObject("WinNT://" & strDomain & "")
colAccounts.Filter = Array("user")
For Each objUser In colAccounts
objExcel.Cells(intRow, 1).Value = UCase(strDomain)
objExcel.Cells(intRow, 2).Value = objUser.Name
intRow = intRow + 1
Next
objExcel.Range("A1:B1").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("B1")
objRange.Sort objRange,1,,,,,,1
MsgBox "Done"
This VBS Script will send all of the NT or Active Directory (AD) domain group names to excel.
objExcel.Cells(1, 2).Value = "Group Name"
Set colGroups = GetObject("WinNT://" & strDomain & "")
colGroups.Filter = Array("group")
For Each objGroup In colGroups
objExcel.Cells(intRow, 2).Value = objGroup.Name
This Script Requires MMC 2.0 and Above.
Set objMMC = CreateObject("MMC20.Application")
objMMC.Show
objMMC.Document.snapins.add("Active Directory Users and Computers")
objMMC.Document.snapins.add("Active Directory Sites and Services")
objMMC.Document.snapins.add("Active Directory Domains and Trusts")
This Script Requires MMC 2.0 And Above.
strSnapin = InputBox("Enter Snapin Name")
objMMC.Document.snapins.add(strSnapin)
This VBS Script will allow you to monitor the SQL Server service state for machines in a text file called MachineList.Txt. If the service is stopped the color will be red.
strServiceName = "MSSQLSERVER"
objExcel.Cells(1, 1).Value = "Machine Name"
objExcel.Cells(1, 2).Value = "Results"
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_Service Where Name = '" & strServiceName & "'")
For Each objItem in colItems
objExcel.Cells(intRow, 1).Value = objItem.SystemName
objExcel.Cells(intRow, 2).Value = objItem.State
If objExcel.Cells(intRow, 2).Value = "Stopped" Then
objExcel.Cells(intRow, 2).Font.ColorIndex = 3
End If
loop
This VBS Script will take a list of machines in a text file called MachineList.Txt and will send their Management Point (MP) information to Excel
objExcel.Cells(1, 2).Value = "Current Management Point"
objExcel.Cells(1, 3).Value = "Site Code"
Set objWMIService = GetObject("winmgmts://" & strComputer & "/root/ccm")
Set colItems = objWMIService.ExecQuery("Select * from SMS_Authority")
strSiteCode = Replace(objItem.Name, "SMS:", "")
objExcel.Cells(intRow, 1).Value = UCase(strComputer)
objExcel.Cells(intRow, 2).Value = objItem.CurrentManagementPoint
objExcel.Cells(intRow, 3).Value = strSiteCode
objExcel.Range("A1:C1").Select
Msgbox "Done"
This VBS Script will allow you to find the collection ID for a specified collection name.
strComputer = InputBox ("Enter Site Server Name")
strSiteCode = InputBox ("Enter Site Code")
strName = InputBox ("Enter Collection Name")
Set objWMIService = GetObject("winmgmts://" & strComputer & "\root\sms\site_" & strSiteCode)
Set colItems = objWMIService.ExecQuery("Select * From SMS_Collection Where Name = '" & strName & "'")
MsgBox "Collection ID: " & objItem.CollectionID _
& Chr(13) & "Collection Name: " & objItem.Name
This VBS Script will send last hardware scan information to Excel for your sites resources.
strServer = InputBox ("Enter Site Server Name")
strDatabase = InputBox ("Enter Three Letter Site Code")
objExcel.Cells(1, 2).Value = "Resource ID"
objExcel.Cells(1, 3).Value = "Time Stamp"
objExcel.Cells(1, 4).Value = "Scan Date"
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.ResourceID, WD.LastHWScan," & _
" Convert(VarChar(11), WD.LastHwScan, 109) CD " & _
" From v_R_System SD" & _
" Join v_Gs_Workstation_Status WD On SD.ResourceID = WD.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("ResourceID").Value
objExcel.Cells(intRow, 3).Value = objRecordSet.Fields("LastHWScan").Value
objExcel.Cells(intRow, 4).Value = objRecordSet.Fields("CD").Value
objRecordSet.MoveNext
Loop
objExcel.Range("A1:D1").Select
Set objRange = objExcel.Range("A1")
strComputer = InputBox ("Enter Machine Name")
Set colGroups = GetObject("WinNT://" & strComputer & "/Administrators")
For Each objUser In colGroups.Members
strServer = InputBox ("Enter Primary Parent Site Server Name")
objExcel.Cells(1, 1).Value = "Site Code"
objExcel.Cells(1, 2).Value = "IP Subnet"
objRecordSet.Open " Select SiteCode, IpSubnet" & _
" From v_SiteBoundary_IPSubnet", objConnection, adOpenStatic, adLockOptimistic
objExcel.Cells(intRow, 1).Value = objRecordSet.Fields("SiteCode").Value
objExcel.Cells(intRow, 2).Value = objRecordSet.Fields("IpSubnet").Value
Here you will find SQL Server 6.5 to SQL Server 2008 Version information to January 2009.
SQL Server 6.5
6.50.201 - SQL Server 6.5 Release To Manufacturing (RTM)
6.50.213 - SQL Server 6.5 Service Pack (SP) 1
6.50.240 - SQL Server 6.5 Service Pack (SP) 2
6.50.258 - SQL Server 6.5 Service Pack (SP) 3
6.50.281 - SQL Server 6.5 Service Pack (SP) 4
6.50.415 - SQL Server 6.5 Service Pack (SP) 5
6.50.416 - SQL Server 6.5 Service Pack (SP) 5A
SQL Server 7.0
7.00.623 - SQL Server 7.0 Release To Manufacturing (RTM)
7.00.699 - SQL Server 7.0 Service Pack (SP) 1
7.00.842 - SQL Server 7.0 Service Pack (SP) 2
7.00.961 - SQL Server 7.0 Service Pack (SP) 3
7.00.1063 - SQL Server 7.0 Service Pack (SP) 4
SQL Server 2000
8.00.194 - SQL Server 2000 Release To Manufacturing (RTM)
8.00.384 - SQL Server 2000 Service Pack (SP) 1
8.00.534 - SQL Server 2000 Service Pack (SP) 2
8.00.760 - SQL Server 2000 Service Pack (SP) 3
8.00.2039 - SQL Server 2000 Service Pack (SP) 4
SQL Server 2005
9.00.1399 - SQL Server 2005 Release To Manufacturing (RTM)
9.00.2047 - SQL Server 2005 Service Pack (SP) 1
9.00.3042 - SQL Server 2005 Service Pack (SP) 2
9.00.3042.01 - SQL Server 2005 Service Pack (SP) 2A
9.00.3054 - SQL Server 2005 KB934458 Fix
9.00.3152 - SQL Server 2005 SP2 Cumulative Update 1
9.00.3175 - SQL Server 2005 SP2 Cumulative Update 2
9.00.3186 - SQL Server 2005 SP2 Cumulative Update 3
9.00.3200 - SQL Server 2005 SP2 Cumulative Update 4
9.00.3215 - SQL Server 2005 SP2 Cumulative Update 5
9.00.3228 - SQL Server 2005 SP2 Cumulative Update 6
9.00.3233 - SQL Server 2005 QFE Security Update
9.00.3239 - SQL Server 2005 SP2 Cumulative Update 7
9.00.3257 - SQL Server 2005 SP2 Cumulative Update 8
9.00.3282 - SQL Server 2005 SP2 Cumulative Update 9
9.00.3294 - SQL Server 2005 SP2 Cumulative Update 10
9.00.3301 - SQL Server 2005 SP2 Cumulative Update 11
9.00.4035 - SQL Server 2005 SP3
9.00.4207 - SQL Server 2005 SP3 Cumulative Update 1
SQL Server 2008
10.00.1600 - SQL Server 2008 Release To Manufacturing (RTM)
10.00.1763 - SQL Server 2008 RTM Cumulative Update 1
10.00.1779 - SQL Server 2008 RTM Cumulative Update 2
10.00.1787 - SQL Server 2008 RTM Cumulative Update 3
strDirectory = "C:\DirectoryFolderName"
Set FSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = fso.GetFolder(strDirectory)
For Each objFile in objFolder.Files
objFile.Delete True