'Author : Babu Dhinakaran
'Date : 9th Jan 2014
'Purpose : To pull OS Installed date on windows servers
Set dateTime = CreateObject("WbemScripting.SWbemDateTime")
filename ="c:\system.txt"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile(filename, 1)
Do Until objTextFile.AtEndOfStream
server = objTextFile.Readline
Set objWMIService = GetObject("winmgmts:\\" & server & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem",,48)
For Each objItem in colItems
dateTime.Value = objItem.InstallDate
dateformat = dateTime.GetVarDate
Next
Wscript.Echo server & vbTab & dateformat & vbNewLine
Loop