User Profile Deletion Utility (Delprof.exe)
Delprof.exe is available in the Windows Server 2003 Resource Kit. It is a command-line utility that you can use to delete user profiles on a local or remote computers running Windows 2000, Windows XP, and Windows Server 2003. User profiles can grow large and may take up considerable disk space, especially if there are several users using one computer. Because of this, you may want to use Delprof.exe to free disk space by deleting profiles that are no longer required. However, because each profile on the computer is presented in order when you run the utility, you may want to use the graphical interface instead of the command-line tool whenever possible.
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=901a9b95-6063-4462-8150-360394e98e1e
Showing posts with label windows. Show all posts
Showing posts with label windows. Show all posts
Wednesday, 28 April 2010
Friday, 29 January 2010
Moving Ubuntu in Company
M$ Windows OS is only supported OS in my company. But I decided to move linux, because i am administrating around 180 Linux bases machine. These are tools which used before and afer .
M$ Office 2007 --> Installed Crossover Linux and M$ Office 2007
M$ Office Communicator --> Pidgin with Office communicator plug in
Windows share --> samba smb://domain;username@host/share and add "connect to a server" applet to panel.
Remote Desktop --> Terminal Server Client
Securcrt --> ssh in console itself with ssh key and clusterssh
wireless --> Also wireless is ok with dynamic wep protected eap with ca certificate and mschapv2 authentication.
internet explorer --> firefox and google chrome
babylon dictionary --> stardict
backup --> ddrescue and rsync for individual folders
gtalk --> cntlm and pidgin
vpn --> kvpnc
itunes --> gtkpod and rhythmbox
M$ Office 2007 --> Installed Crossover Linux and M$ Office 2007
M$ Office Communicator --> Pidgin with Office communicator plug in
Windows share --> samba smb://domain;username@host/share and add "connect to a server" applet to panel.
Remote Desktop --> Terminal Server Client
Securcrt --> ssh in console itself with ssh key and clusterssh
wireless --> Also wireless is ok with dynamic wep protected eap with ca certificate and mschapv2 authentication.
internet explorer --> firefox and google chrome
babylon dictionary --> stardict
backup --> ddrescue and rsync for individual folders
gtalk --> cntlm and pidgin
vpn --> kvpnc
itunes --> gtkpod and rhythmbox
Tuesday, 28 July 2009
Performance Analysis of Logs (PAL) Tool
This tool helps to analyse and create report from perfomance counter of Windows systems.
Just collect performance counters and you will find everything in the gui.
Best part is you can select server types like Exchange or Sql is running on server.
http://www.codeplex.com/PAL
Just collect performance counters and you will find everything in the gui.
Best part is you can select server types like Exchange or Sql is running on server.
http://www.codeplex.com/PAL
Thursday, 28 May 2009
How to convert snoop output to read in Ethereal
Snoop to a file in Solaris
# snoop -o test.snoopraw
Transfer your file in binary mode to your windows machine.
under your wireshark installation folder find editcap application and convert your file to wireshark
"D:\Program Files\Wireshark\editcap.exe" "d:\testsnoopraw" "d:\testsnoopraw.snoop"
# snoop -o test.snoopraw
Transfer your file in binary mode to your windows machine.
under your wireshark installation folder find editcap application and convert your file to wireshark
"D:\Program Files\Wireshark\editcap.exe" "d:\testsnoopraw" "d:\testsnoopraw.snoop"
Monday, 18 May 2009
Repair Master Boot Record
When installing Ubuntu you may delete MBR. MBR point grub instead of Windows bootloader. If you want to move Windows bootloader again you can use fixmbr command.
Fixmbr - Repair Master Boot Record with MBRFix from Windows 2000, XP etc. instead of using fdisk /mbr. FixMbr could help you recreating original master boot record (MBR) that works with any Windows (Win2k), XP, 95, 98 when Linux LILO damaged it.
download from here http://www.ambience.sk/fdisk-master-boot-record-windows-linux-lilo-fixmbr.php
If you have one disk enter this command. If you have more than 1 physicial hard disk (hard drive), you have to use proper number for your disk
mbrfix /drive 0 fixmbr
If you could not boot your OS then use Windows Cd boot in recovery mode and in the command prompt use fdisk /mbr
Fixmbr - Repair Master Boot Record with MBRFix from Windows 2000, XP etc. instead of using fdisk /mbr. FixMbr could help you recreating original master boot record (MBR) that works with any Windows (Win2k), XP, 95, 98 when Linux LILO damaged it.
download from here http://www.ambience.sk/fdisk-master-boot-record-windows-linux-lilo-fixmbr.php
If you have one disk enter this command. If you have more than 1 physicial hard disk (hard drive), you have to use proper number for your disk
mbrfix /drive 0 fixmbr
If you could not boot your OS then use Windows Cd boot in recovery mode and in the command prompt use fdisk /mbr
Friday, 27 March 2009
Access Linux Partitions (ext2/ext3) From Windows OS
Explore2fs: http://www.chrysocome.net/explore2fs
Ext2 Installable File System For Windows: http://www.fs-driver.org/index.html
DiskInternals Linux Reader: http://www.diskinternals.com/linux-reader
Ext2 Installable File System For Windows: http://www.fs-driver.org/index.html
DiskInternals Linux Reader: http://www.diskinternals.com/linux-reader
Wednesday, 12 November 2008
Ftp for Windows OS error handling
I need a ftp script for uploading files but in Windows OS this is not easy to handle. Error handling is painfull.
I wrote a python script, which you can supply two argument; local directory and file name you want to upload. So you can run this ftp python from batch file or vbscript.
It has good error handling for most kind of errors, could send email to you. Please fill related parameters. You should have running smtp server for getting email.
I put two vbscript function below, which can handle calling python script and send email in case of error.
First function for calling ftp python script.
Second function for sending email in case of vbscript error.(You should put "on error resume next" in your script)
Python ftp script starts here
I wrote a python script, which you can supply two argument; local directory and file name you want to upload. So you can run this ftp python from batch file or vbscript.
It has good error handling for most kind of errors, could send email to you. Please fill related parameters. You should have running smtp server for getting email.
I put two vbscript function below, which can handle calling python script and send email in case of error.
First function for calling ftp python script.
Second function for sending email in case of vbscript error.(You should put "on error resume next" in your script)
Function ftppython(ftpfile)
Set objShell = CreateObject("WScript.Shell")
objShell.Run "E:\dirofyourscript\ftp.py E:\sysadmins\log "&ftpfile, 0, False
If Err.number <> 0 Then
sendanemail()
End If
Set objShell = Nothing
end function
Function sendanemail
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Problem mnp1 alarm script"
objMessage.From = "mail@domain.com"
objMessage.To = "youremail@domain.com;anotheremail@domain.com"
objMessage.TextBody = "Problem script"
objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "IPAdressofyoursmtp"
objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objMessage.Configuration.Fields.Update
objMessage.Send
end function
Python ftp script starts here
from ftplib import FTP
import sys, os, os.path, operator, shutil, smtplib
def upload(handle,filename):
f = open(filename,"rb")
(base,ext) = os.path.splitext(filename)
picext = ".bmp .jpg .jpeg .dib .tif .tiff .gif .png"
if(operator.contains(picext,ext)):
try:
handle.storbinary("STOR " + filename,f,1)
except Exception:
sendanemailo("Successful upload,but check it")
else:
print "Successful upload."
f.close()
return
try:
handle.storbinary("STOR " + filename,f)
except Exception:
sendanemail("Successful upload, but check it.")
else:
print "Successful upload."
f.close()
return
def download(handle,filename):
f2 = open(filename,"wb")
try:
handle.retrbinary("RETR " + filename,f2.write)
except Exception:
sendanemail("Error in downloadtelneting the remote file.")
return
else:
print "Successful download!"
f2.close()
return
def sendanemail(msg):
fromaddr = "from@domain.com"
toaddrs = "tome@domain.com"
subject = "ftp problem"
headers = "From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n" % (fromaddr, toaddrs, subject)
message = headers + msg
server = smtplib.SMTP('ipadressofmailserver')
server.sendmail(fromaddr, toaddrs, message)
server.quit()
sys.exit()
return
#here are some parameters
host_name = "writeipaddress"
user = "user"
pwd = "password"
oldlocaldir = "z:\\sysadmins\log"
remotedir= "/remote/dir/"
if len(sys.argv) != 3:
sendanemail("there is no argument")
sys.exit()
uploadfile= sys.argv[2]
localdir = sys.argv[1]
os.chdir(localdir)
if not os.path.exists(uploadfile):
sendanemail("There is no file to upload")
sys.exit
if not os.path.exists(oldlocaldir):
sendanemail("There is no dir to move files")
sys.exit()
if not os.path.exists(localdir):
sendanemail("There is no local dir")
sys.exit()
try: ftph = FTP(host_name)
except:
sendanemail("Host could not be resolved.")
sys.exit()
else: pass
try:
ftph.login(user,pwd)
except Exception:
sendanemail("Invalid login combination.")
sys.exit()
else:
print "Successfully connected!\n"
try: os.chdir(localdir)
except:
sendanemail("chdir problem ")
sys.exit()
try: ftph.cwd(remotedir)
except:
sendanemail("there is problem in remotedir")
sys.exit()
try: upload(ftph,uploadfile)
except:
sendanemail("upload problem")
ftph.close()
try: shutil.move (uploadfile,oldlocaldir)
except:
sendanemail("problem move file")
Friday, 18 April 2008
Use a PAE enabled kernel
If server has 4 GB or more memory, some operating systems may not access all of the memory. 64 bit OS are out of this subject.
Some PCI, PCI-X and PCI-Express cards use memory below 4 GB which known as PCI hole or PCI Extended Configuration Space. This space could not allocated for system memory and relocated above 4 GB. Then if the operating system is not PAE enabled or not allowed to because of limitation (like Windows Standart edition) could not use this memory location and shows less then 4 GB.
For Windows edition you can add /PAE switch to the boot.ini. (not for XP and standart edition)
For Linux
I confused, because kernel-smp (2.6) versions say that it is supporting up to 16 GB.
But You have to install bigsmp kernel instead of smp for SUSE. And i686-smp or hugemem kernels for Red Hat. (kernel-hugemem is required for memory configurations higher than 16 GB).
There is kernel-pae packeges for some distributions(Fedora, CentOS).
You can find warning message "Use a PAE enabled kernel" from output of dmesg command.
BTW There is another option that you can compile your kernel.
Some PCI, PCI-X and PCI-Express cards use memory below 4 GB which known as PCI hole or PCI Extended Configuration Space. This space could not allocated for system memory and relocated above 4 GB. Then if the operating system is not PAE enabled or not allowed to because of limitation (like Windows Standart edition) could not use this memory location and shows less then 4 GB.
For Windows edition you can add /PAE switch to the boot.ini. (not for XP and standart edition)
For Linux
I confused, because kernel-smp (2.6) versions say that it is supporting up to 16 GB.
But You have to install bigsmp kernel instead of smp for SUSE. And i686-smp or hugemem kernels for Red Hat. (kernel-hugemem is required for memory configurations higher than 16 GB).
There is kernel-pae packeges for some distributions(Fedora, CentOS).
You can find warning message "Use a PAE enabled kernel" from output of dmesg command.
BTW There is another option that you can compile your kernel.
Thursday, 3 April 2008
Hp, Windows Server 2003 support matrix
HP Windows Server Operating System Support Matrix
http://h71028.www7.hp.com/enterprise/cache/461942-0-0-0-121.html
Microsoft Windows Server 2003 matrix
http://www.microsoft.com/technet/windowsserver/evaluate/features/compare.mspx
Switches to enable more memory for Windows
boot.ini
/3GB /PAE
http://www.microsoft.com/whdc/system/platform/server/pae/default.mspx
http://www.microsoft.com/whdc/system/platform/server/PAE/pae_os.mspx
http://www.microsoft.com/whdc/system/platform/server/PAE/PAEmem.mspx
http://h71028.www7.hp.com/enterprise/cache/461942-0-0-0-121.html
Microsoft Windows Server 2003 matrix
http://www.microsoft.com/technet/windowsserver/evaluate/features/compare.mspx
Switches to enable more memory for Windows
boot.ini
/3GB /PAE
http://www.microsoft.com/whdc/system/platform/server/pae/default.mspx
http://www.microsoft.com/whdc/system/platform/server/PAE/pae_os.mspx
http://www.microsoft.com/whdc/system/platform/server/PAE/PAEmem.mspx
Friday, 29 February 2008
Tools for Troubleshooting Windows Server
http://www.microsoft.com/downloads/details.aspx?FamilyID=115905a2-2507-41db-9195-2e73c8a196a2&DisplayLang=en
Here is the list of tools which explained in the document.
Dependency Walker
Application and Service Tools
-Eventtriggers
-Event Viewer
-Gpresult
-Openfiles
-Performance Logs and Alerts
-Program Compatibility Wizard
-The Resultant Set of Policy
-Runas
-Sc
-Taskkill
-Tasklist
-Task Manager
Operating System and Driver Tools
-Boot Logging
-Device Manager
-Driver Verifier Manager
-Error Reporting Service
-File Signature Verification
-Kernel Debuggers
-Memory Pool Monitor
Online Crash Analysis
Recovery Console
Shutdown Event Tracker
System Configuration Utility (Msconfig.exe)
Systeminfo (systeminfo.exe)
System Information (msinfo32)
Wmic
Windows Update
Disk Tools
-Chkdsk
-Disk Cleanup
Networking Tools
-Arp
-Ipconfig
-Net
-Netdiag
-Netstat
-Network Monitor
-Nslookup
-Pathping
-Portqry
-Telnet Client
Remote Management Tools
-Computer Management
-Emergency Management Services
-Remote Desktop
-Telnet Server
Here is the list of tools which explained in the document.
Dependency Walker
Application and Service Tools
-Eventtriggers
-Event Viewer
-Gpresult
-Openfiles
-Performance Logs and Alerts
-Program Compatibility Wizard
-The Resultant Set of Policy
-Runas
-Sc
-Taskkill
-Tasklist
-Task Manager
Operating System and Driver Tools
-Boot Logging
-Device Manager
-Driver Verifier Manager
-Error Reporting Service
-File Signature Verification
-Kernel Debuggers
-Memory Pool Monitor
Online Crash Analysis
Recovery Console
Shutdown Event Tracker
System Configuration Utility (Msconfig.exe)
Systeminfo (systeminfo.exe)
System Information (msinfo32)
Wmic
Windows Update
Disk Tools
-Chkdsk
-Disk Cleanup
Networking Tools
-Arp
-Ipconfig
-Net
-Netdiag
-Netstat
-Network Monitor
-Nslookup
-Pathping
-Portqry
-Telnet Client
Remote Management Tools
-Computer Management
-Emergency Management Services
-Remote Desktop
-Telnet Server
Friday, 8 February 2008
Export Local Group Policy settings to other Pc
If you want to move local policy settings to other Windows OS, move files under %systemroot%\system32\grouppolicy\ to other system.
Also if you delete files under this directory, you system will not have group policy. Do not forget to log off log on.
If you are managing workgroup. You can use this method for distributing policy.
Also if you delete files under this directory, you system will not have group policy. Do not forget to log off log on.
If you are managing workgroup. You can use this method for distributing policy.
Thursday, 24 January 2008
Data Execution Prevention problems
After converting physical machine to VMware virtual machine, I had problems opening display properties. Data execution prevention prevented some features.
Changing settings under system properties --> advanced--> data execution prevention and allowing application did not help.
So I edited boot.ini and disabled DEP via adding /noexecute=AlwaysOff .
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect /NoExecute=AlwaysOff
A detailed description of the Data Execution Prevention (DEP) feature in Windows XP Service Pack 2, Windows XP Tablet PC Edition 2005, and Windows Server 2003
http://support.microsoft.com/kb/875352
Changing settings under system properties --> advanced--> data execution prevention and allowing application did not help.
So I edited boot.ini and disabled DEP via adding /noexecute=AlwaysOff .
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect /NoExecute=AlwaysOff
A detailed description of the Data Execution Prevention (DEP) feature in Windows XP Service Pack 2, Windows XP Tablet PC Edition 2005, and Windows Server 2003
http://support.microsoft.com/kb/875352
Saturday, 12 January 2008
Monday, 10 September 2007
Schtasks
I set scheduled tasks with schtasks command to create for all servers.
This command create task which runs every 5 minutes.
schtasks /create /s "\\server" /U domain\username /p "password" /SC MINUTE /MO 5 /tn taskname /tr "scriptpath"
ERROR: passing the user credential on local connection.
You have to give server name in this format "\\server"
This command create task which runs every 5 minutes.
schtasks /create /s "\\server" /U domain\username /p "password" /SC MINUTE /MO 5 /tn taskname /tr "scriptpath"
ERROR: passing the user credential on local connection.
You have to give server name in this format "\\server"
Monday, 27 August 2007
Hp Openview active passive state
I coded this script because hp openview does not have script to track status of active and passive system together and reflect status of service(I mean two server is working for one aim) in service graph screen.
Put this script both active and passive system. It is going to help tracking status of servers and if active system goes down the script running on passive system change status to critical in service graph screen. If passive system goes down the script on the active system is going to change status to ok in service graph screen why because active system is working, so you are serving you service.
You have to create this file C:\Documents and Settings\Administrator\Desktop\ACTIVE on the active server.
Put this script both active and passive system. It is going to help tracking status of servers and if active system goes down the script running on passive system change status to critical in service graph screen. If passive system goes down the script on the active system is going to change status to ok in service graph screen why because active system is working, so you are serving you service.
You have to create this file C:\Documents and Settings\Administrator\Desktop\ACTIVE on the active server.
Dim machine
Set fs=CreateObject("Scripting.FileSystemObject")
machine = "server1" 'write other server
'If you can ping server
If reachable(machine) Then
'wscript.echo machine & " reachable"
'Check if you send alarm before, clear alarm because you can ping
If fs.FileExists ("c:\alarm.lck")then
'WScript.Echo ("alarm send, clear the alarm")
strstate= "normal"
hpov (strstate)
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile("C:\alarm.lck")
Else
'WScript.Echo ("Nothing to do")
End If
Else
'You cant ping server
'wscript.echo machine & " not reachable"
'Check if this server is active
If fs.FileExists("C:\Documents and Settings\Administrator\Desktop\ACTIVE") Then
'WScript.Echo ("This is active system")
If fs.FileExists ("c:\alarm.lck")then
'WScript.Echo ("You send alarm before, clearing the alarm,if you can reach the HP Openview")
strstate= "normal"
hpov (strstate)
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile("C:\alarm.lck")
End If
Else
'WScript.Echo ("This is passive system")
'This server is passive
'Check if you send alarm to hpov
If fs.FileExists ("c:\alarm.lck")then
'WScript.Echo ("something")
Else
'You didnt send alarm Hpov before so send alarm now because you cant ping active server
'WScript.Echo ("Send alarm")
strstate = "critical"
hpov (strstate)
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CreateTextFile("C:\alarm.lck")
End If
End If
End If
Function hpov(state)
'WScript.Echo state
Set objShell = CreateObject("WScript.Shell")
strMessage="""Node down : server1"""
'Ask you hp openview administrator about command and arguments.
strCommand = "C:\usr\OV\bin\Opc\opcmsg severity=" & state & " a=IMA o=Node_Down msg_text=" &strMessage& " msg_grp=TCELL node=server2 service_id=ima_server2_scr"
'WScript.Echo strcommand
intRC = objShell.Run (strCommand,1 ,TRUE)
End Function
function reachable(HostName)
dim wshShell, fso, tfolder, tname, TempFile, results, retString, ts
Const ForReading = 1, TemporaryFolder = 2
reachable = False
set wshShell=wscript.createobject("wscript.shell")
set fso = CreateObject("Scripting.FileSystemObject")
Set tfolder = fso.GetSpecialFolder(TemporaryFolder)
tname = fso.GetTempName
TempFile = tfolder & tname
'-w 100000 is 5 mins worth of timeout to cope with establishing a dialup
wshShell.run "cmd /c ping -n 3 -w 1000 " & HostName & ">" & TempFile,0,true
set results = fso.GetFile(TempFile)
set ts = results.OpenAsTextStream(ForReading)
do while ts.AtEndOfStream <> True
retString = ts.ReadLine
if instr(retString, "Reply")>0 then
reachable = true
exit do
end If
Loop
ts.Close
results.delete
end Function
Hp Openview Microsoft Windows file check template
Hp Openview does not have all the scripts for Windows, so I coded this vbscript to help us checking if the file exist and changes related monitoring status. This script has to be run from hp openview services. You have to call script with file name and monitoring name from HP Openview.
strArgument1 = Wscript.Arguments(0) 'file name
strArgument2 = Wscript.Arguments(1) 'monitor name
Set objFs=CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("WScript.Shell")
StrOpcmon = "c:\usr\OV\bin\OpC\opcmon"
If objFs.FileExists (strArgument1)then
strCommand = StrOpcmon & " " & strArgument2 & "=1"
intRC = objShell.Run (strCommand,1 ,TRUE)
Else
strCommand = StrOpcmon & " " & strArgument2 & "=0"
intRC = objShell.Run (strCommand,1 ,TRUE)
End If
Wednesday, 22 August 2007
Script for dumping information from Mssql tables
(select from top to end of script , copy and paste to your editor)
Const adOpenStatic = 3
Const adLockOptimistic = 3
Set objConnection = CreateObject("ADODB.Connection")
objConnection.Open "Provider=SQLOLEDB;server=servername;database=msdb;uid=sa;password=password"
Set objRecordSet = CreateObject("ADODB.Recordset")
objRecordSet.Open "SELECT * FROM sysjobs", objConnection, adOpenStatic, adLockOptimistic
objRecordSet.MoveFirst
'excel output
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
objExcel.Workbooks.Add
'chane field name for which column you dump
X=1
Do Until objRecordSet.EOF
objExcel.Cells(x, 1).Value = objRecordSet.Fields("name").Value
objRecordSet.MoveNext
x=x+1
Loop
'XML output
'objRecordSet.Save "output.xml" , adPersistXML
'Number of record
'Wscript.Echo objRecordSet.RecordCount
'Wscript.Echo objRecordSet.Fields("name").Value
'Close connection
objRecordSet.Close
objConnection.Close
Script to get board information of your computer
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_BaseBoard")
For Each objItem in colItems
For Each strOption in objItem.ConfigOptions
Wscript.Echo "Configuration Option: " & strOption
Next
Wscript.Echo "Depth: " & objItem.Depth
Wscript.Echo "Description: " & objItem.Description
Wscript.Echo "Height: " & objItem.Height
Wscript.Echo "Hosting Board: " & objItem.HostingBoard
Wscript.Echo "Hot Swappable: " & objItem.HotSwappable
Wscript.Echo "Manufacturer: " & objItem.Manufacturer
Wscript.Echo "Model: " & objItem.Model
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "Other Identifying Information: " & _
objItem.OtherIdentifyingInfo
Wscript.Echo "Part Number: " & objItem.PartNumber
Wscript.Echo "Powered-On: " & objItem.PoweredOn
Wscript.Echo "Product: " & objItem.Product
Wscript.Echo "Removable: " & objItem.Removable
Wscript.Echo "Replaceable: " & objItem.Replaceable
Wscript.Echo "Requirements Description: " & objItem.RequirementsDescription
Wscript.Echo "Requires Daughterboard: " & objItem.RequiresDaughterBoard
Wscript.Echo "Serial Number: " & objItem.SerialNumber
Wscript.Echo "SKU: " & objItem.SKU
Wscript.Echo "Slot Layout: " & objItem.SlotLayout
Wscript.Echo "Special Requirements: " & objItem.SpecialRequirements
Wscript.Echo "Tag: " & objItem.Tag
Wscript.Echo "Version: " & objItem.Version
Wscript.Echo "Weight: " & objItem.Weight
Wscript.Echo "Width: " & objItem.Width
Next
Vbscript get model of your server
SystemName = "localhost"
set tmpObj = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & SystemName & "\root\cimv2").InstancesOf ("Win32_ComputerSystem")
for each tmpItem in tmpObj
MakeModel = trim(tmpItem.Manufacturer) & " " & trim(tmpItem.Model)
next
Set tmpObj = Nothing: Set tmpItem = Nothing
msgbox MakeModel
Vbscript listing memory config
Sometimes our bosses ask about configuration of memories or you need to detailed information about memory configuration, may be you will add extra memory and you want to learn bank status without restarting server.
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_PhysicalMemory")
For Each objItem in colItems
Wscript.Echo "Bank Label: " & objItem.BankLabel
Wscript.Echo "Capacity: " & objItem.Capacity / 1048576
Wscript.Echo "Data Width: " & objItem.DataWidth
Wscript.Echo "Description: " & objItem.Description
Wscript.Echo "Device Locator: " & objItem.DeviceLocator
Wscript.Echo "Form Factor: " & objItem.FormFactor
Wscript.Echo "Hot Swappable: " & objItem.HotSwappable
Wscript.Echo "Manufacturer: " & objItem.Manufacturer
Wscript.Echo "Memory Type: " & objItem.MemoryType
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "Part Number: " & objItem.PartNumber
Wscript.Echo "Position In Row: " & objItem.PositionInRow
Wscript.Echo "Speed: " & objItem.Speed
Wscript.Echo "Tag: " & objItem.Tag
Wscript.Echo "Type Detail: " & objItem.TypeDetail
Wscript.Echo "-------------------------"
Next
Subscribe to:
Posts (Atom)