Home

Network Management Software
Network Managment Software

Zero Connect is dedicated to quality Network Management Software. We work on networks of all sizes and develop the best network management tools to complete critical network tasks.

 
  WMI Management: Scripting that allows you to quickly audit or benchmark the speed of a computer, network user name and other important details. Below is an example of a WMI Script created by ZeroConnect to log Username,Computer Name, Cpu Manufacturer, and CPU Speed along with the current date to a text file "c:\status.txt". This script can be placed in users NT login script section in order to audit their systems and record valuable I.T. data.  
 


Network Management Software
loginscript.vbs
Copy Right ZeroConnect
Contact ZeroConnect for more details at rainmakerpsi@yahoo.com


'Systems Managment
'Created by ZeroConnect
'4/23/03
'This is a WMI VBS script designed to inventory end-user computers.

On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Processor")
For Each objItem in colItems

'this displays the property to the screen
'For Testing only, this line is not being used.
'Wscript.Echo "Maximum Clock Speed: " & objItem.MaxClockSpeed


'Make sure we can use our Network objects.
Set WshNetwork = WScript.CreateObject("WScript.Network")
Set oDrives = WshNetwork.EnumNetworkDrives
Set oPrinters = WshNetwork.EnumPrinterConnections

'this appends the data to the file.
Const ForAppending = 2
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile _
("c:\status.txt", 8, True)
Set colServices = GetObject("winmgmts:")
objTextFile.WriteLine("Domain: " & WshNetwork.UserDomain)
objTextFile.WriteLine("User Name: " & WshNetwork.UserName)
objTextFile.WriteLine("Computer Name: " & WshNetwork.ComputerName)
objTextFile.WriteLine("Computer speed in MHZ: " & objItem.MaxClockSpeed)
objTextFile.WriteLine("CPU Manufacturer: " & objItem.Manufacturer)
objTextFile.WriteLine("CPU Details: " & objItem.Description)

'Get our Date to Write to the file
strComputer = "."
Set objSWbemServices = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colTimeZone = objSWbemServices.ExecQuery _
("SELECT * FROM Win32_TimeZone")
For Each objTimeZone in colTimeZone
strBias = objTimeZone.Bias
Next

dtmCurrentDate = Date
dtmTargetDate = Year(dtmCurrentDate)

dtmMonth = Month(dtmCurrentDate)
If Len(dtmMonth) = 1 Then
dtmMonth = "0" & dtmMonth
End If

dtmTargetDate = dtmTargetDate & dtmMonth

dtmDay = Day(dtmCurrentDate)
If Len(dtmDay) = 1 Then
dtmDay = "0" & dtmDay
End If
objTextFile.WriteLine("Date: " & dtmCurrentDate)
objTextFile.WriteLine("")
objTextFile.Close

Next



 

Privacy Policy

This Script is Listed on: