Friday 17 August 2012

Check Remote Machine Antivirus Version using VB script




The save below script somthing like(*.vbs)  or MyScript.vbs and your machines list will be saved in text file, and the Text file shold have the MachineList.Txt

Once you run the "myscript.vbs" it will create the book1.xls file which will contain all the details like (
Machine Name Parent Server SAV Version Virus Definition Rev Number Status Report Time Stamp)

On Error Resume Next

Const ForReading = 1
Const HKEY_LOCAL_MACHINE = &H80000002
x = 2

'Create an Excel Work Sheet

Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
objExcel.Workbooks.Add

objExcel.Cells(1, 1).Value = "Machine Name"
objExcel.Cells(1, 2).Value = "Parent Server"
objExcel.Cells(1, 3).Value = "SAV Version"
objExcel.Cells(1, 4).Value = "Virus Definition"
objExcel.Cells(1, 5).Value = "Rev Number"
objExcel.Cells(1, 6).Value = "Status"
objExcel.Cells(1, 7).Value = "Report Time Stamp"

objExcel.Range("A1:G1").Select
objExcel.Selection.Interior.ColorIndex = 19
objExcel.Selection.Font.ColorIndex = 11
objExcel.Selection.Font.Bold = True
objExcel.Cells.EntireColumn.AutoFit


'Read machine names from a txt file

Set Fso = CreateObject("Scripting.FileSystemObject")
Set InputFile = fso.OpenTextFile("MachineList.Txt")
Do While Not (InputFile.atEndOfStream)
strComputer = InputFile.ReadLine

intRow = x

objExcel.Cells(intRow, 1).Value = strComputer

GetRegInfo

GetDefInfo

objExcel.Cells(intRow, 7).Value = Now()

set strValue = Nothing
set dwValue = Nothing
set strSavVersion = Nothing
set objFSO = Nothing
Set objFile = Nothing
Set dtDefDate = Nothing
Set strRevNumber= Nothing

x = x + 1

Loop

Wscript.Echo "Done"

'*********************************************************************************************************
'Get information from Registry

Sub GetRegInfo

Set oReg=GetObject( _
   "winmgmts:{impersonationLevel=impersonate}!\\" &_
    strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\INTEL\LANDesk\Common Api\"
strParent = "UniqueID"
strProversion = "ProductVersion"

oReg.GetStringValue _
   HKEY_LOCAL_MACHINE,strKeyPath,strParent,strValue

objExcel.Cells(intRow, 2).Value = strValue

oReg.GetDWORDValue _
   HKEY_LOCAL_MACHINE,strKeyPath,strProversion,dwValue

Select Case dwValue

Case 328336375
strSavVersion ="10.1.5.5010"

Case 23528424
strSavVersion = "10.0.0.359"

Case 65537001
strSavVersion = "10.0.1.1000"

Case 65995753
strSavVersion = "10.0.1.1007"

Case 66061289
strSavVersion = "10.0.1.1008"

Case 131073002
strSavVersion = "10.0.2.2000"

Case 131138538
strSavVersion = "10.0.2.2001"

Case 131728362
strSavVersion = "10.0.2.2010"

Case 132383722
strSavVersion = "10.0.2.2020"

Case 132449258
strSavVersion = "10.0.2.2021"

Case 25822194
stSavVersion = "10.1.0.394"

Case 25953266
strSavVersion = "10.1.0.396"

Case 26215410
strSavVersion = "10.1.0.400"

Case 26280946
strSavVersion = "10.1.0.401"

Case 65536905
strSavVersion = "9.0.5.1000"

Case 72090503
strSavVersion = "9.0.3.1100"

Case 65536903
strSavVersion = "9.0.3.1000"

Case 65536902
strSavVersion = "9.0.2.1000"

Case 65536901
strSavVersion = "9.0.1.1000"

Case 22152068
StrSavversion = "9.0.0.338"

Case 21562155
strSavVersion = "8.1.1.329"

Case 21168939
strSavVersion = "8.1.1.323"

Case 20906795
strSavVersion = "8.1.1.319"

Case 20579115
strSavVersion = "8.1.1.314"

Case 54068001
strSavVersion = "8.1.0.825"

Case 29950753
strSavVersion = "8.0.1.457"

Case 614597408
strSavVersion = "8.0.0.9378"

Case 614335264
strSavVersion = "8.0.0.9374"

Case 29229856
strSavVersion = "8.0.0.446"

Case 28640032
strSavVersion = "8.0.0.437"

Case 28443424
strSavVersion = "8.0.0.434"

Case 28115744
strSavVersion = "8.0.0.429"

Case 27853600
strSavVersion = "8.0.0.425"

Case 85197700
strSavVersion = "7.60.926"

Case 61997817
strSavVersion = "7.6.1.946"

Case 61473529
strSavVersion = "7.6.1.938"

Case 60949241
strSavVersion = "7.6.1.930"

Case 60687096
strSavVersion = "7.6.1.926"

Case 55509743
strSavVersion = "7.5.1.847"

Case 48366268
strSavVersion = "7.0.0"

End Select

objExcel.Cells(intRow, 3).Value = strSavVersion

End Sub

'*******************************************************************************************************************
'Get Virus definition from definfo.dat.

Sub GetDefInfo

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile("\\" & strComputer & _
  "\c$\Program Files\Common Files\Symantec Shared\VirusDefs\definfo.dat")

If objFSO.FileExists(objFile) Then
Set objDatFile = objFSO.OpenTextFile(objFile, 1)
Do Until objDatFile.AtEndOfStream
strLine = objDatFile.Readline
intCurDefs = InStr(strLine , "CurDefs")
   If intCurDefs > 0 Then
   strCurDefs = strLine
   strDateDefs = Mid(strCurDefs, 9, 8)

   dtYear = Left(strDateDefs, 4)
   dtMonth = Mid(strDateDefs, 5, 2)
   dtDay = Right(strDateDefs, 2)
   DateVirDefs = dtMonth & "/" & dtDay & "/" & dtYear
   dtDefDate = CDate(DatevirDefs)

   objExcel.Cells(intRow, 4).Value = dtDefDate

 If (date - dtDefDate) = 1 Then
 objExcel.Cells(intRow, 6).Value = "OK"
 Else
 objExcel.Cells(intRow, 6).Value = "Need Attention!"
 End If
 
   strRevNumber = Right(strCurDefs, 3)
   objExcel.Cells(intRow, 5).Value = strRevNumber
    
   End If
   Loop
   objDatFile.Close

Else
objExcel.Cells(intRow, 4).Value = "The file definfo.dat does not exist"

End If

End Sub

How to Create a Forward Lookup Zone in w2k3


DNS

This article is a step-by-step guide to creating a Domain Name System (DNS) zone for a new domain.

Note This article does not apply to Active Directory-integrated DNS zones. For additional information about how to setup DNS for Active Directory in Microsoft Windows Server 2003, click the following article numbers to view the articles in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/816101/ )
HOWTO: Convert DNS Primary Server to Active Directory Integrated
(http://support.microsoft.com/kb/323418/ )
HOW TO: Integrate DNS with an Existing DNS Infrastructure If Active Directory Is Enabled in Windows Server 2003
(http://support.microsoft.com/kb/324753/ )
HOW TO: Create an Active Directory Server in Windows Server 2003


How to Create a Forward Lookup Zone
To create a new forward lookup zone:
1.       Start the DNS snap-in. To do this, click Start, point to Administrative Tools, and then click DNS.
2.       Click the DNS Server object for your server in the left pane of the console, and then expand the server object to expand the tree.
3.       Right-click Forward Lookup Zones, and then click New Zone. The New Zone Wizard starts. Click Next to continue.
4.       Click Primary zone to create a master copy of the new zone. Click Next.
5.       In the Name box, type the name of the zone (for example, type _tcp.example.com, and then click Next.

NOTE: This name is typically the same as the DNS suffix of the host computers for which you want to create the zone.
6.       On the Zone File page, accept the default file name for the new zone file, and then click Next.
7.       Click Next.
8.       Click Finish.
The new zone is listed under Forward Lookup Zones in the DNS tree.

How to Modify the Forward Lookup Zone Properties
To modify or verify the zone properties:
1.       Start the DNS snap-in.
2.       Click the DNS Server object for your server in the left pane of the console, and then expand the server object to expand the tree.
3.       Expand Forward Lookup Zones.
4.       Under Forward Lookup Zones, right-click the zone that you want (for example, example.com), and then click Properties.
5.       In the Allow dynamic updates list, click Yes.
6.       Click the Start of Authority (SOA) tab.
7.       In the Responsible person box, type the e-mail address that you want (in the format of "username.domain.com"). For example, if the e-mail address is support@example.com, type support.example.com.
8.       Click Apply, and then click OK.

How to Create a Reverse Lookup Zone
To create a new reverse lookup zone:
1.       Start the DNS snap-in.
2.       Click the DNS Server object for your server in the left pane of the console, and then expand the server object to expand the tree.
3.       Expand Reverse Lookup Zones.
4.       Right-click Reverse Lookup Zones, and then click New Zone. The New Zone Wizard starts. Click Next to continue.
5.       Click Primary zone, and then click Next.
6.       In the Network ID box, type the network ID. For example, type 192.168.0, and then click Next.

NOTE: The network ID is that portion of the TCP/IP address that pertains to the network. For additional information about TCP/IP networks, click the article number below to view the article in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/164015/EN-US/ )
Understanding TCP/IP Addressing and Subnetting Basics
7.       On the Zone File page, click Next
8.       Click Next.
9.       Click Finish.
The new zone is listed under Reverse Lookup Zones in the DNS tree.

How to Modify the Reverse Lookup Zone Properties
To modify or verify the zone properties:
1.       Start the DNS snap-in.
2.       Click the DNS Server object for your server in the left pane of the console, and then expand the server object to expand the tree.
3.       Expand Reverse Lookup Zones.
4.       Under Reverse Lookup Zones, right-click the zone that you want (for example, 102.168.0.x Subnet), and then click Properties.
5.       In the Allow dynamic updates list, click Yes.
6.       Click the Start of Authority (SOA) tab.
7.       In the Responsible person box, type the e-mail address that you want (in the format of "username.domain.com"). For example, if the e-mail address is support@example.com, type support.example.com.
8.       Click Apply, and then click OK.
NOTE: When you create the forward and reverse lookup zones, the DNS service automatically creates an "A" record for the DNS server. However, it does not create a PTR record, or reverse lookup record, for the DNS server.

To create a PTR record for the DNS server:
1.       Right-click the reverse lookup zone (for example, 192.168.0.x Subnet), and then click New Pointer (PTR).
2.       In the Host IP number box, type the host portion of the DNS server IP address. For example, if the DNS server is on a "C" class network and has an IP address of 192.168.0.10, the host portion of the IP address is 10. In this case, type 10.
3.       In the Host name box, type the host name of the DNS server. For example, type dnsserv.example.com.
4.       Click OK.

How to Create a Host Record
To create a host or "A" record:
1.       Start the DNS snap-in.
2.       Click the DNS Server object for your server in the left pane of the console, and then expand the server object to expand the tree.
3.       Expand Forward Lookup Zones.
4.       Under Forward Lookup Zones, right-click the zone that you want (for example, example.com), and then click New Host (A).
5.       In the Name (uses parent domain name if blank) box, type the name of the host that you want to add. For example, if you want to add a host record for a Web server, type www.
6.       In the IP address box, type the IP address of the host that you want to add. For example, type 192.168.0.100.
7.       Select the Create associated pointer (PTR) record check box, and then click Add Host. You receive a message similar to the following:
The host record www.example.com was successfully created.
Click OK.
8.       When you are finished adding hosts, click Done.
How to Add a CNAME
A CNAME (or "Canonical Name") is an alias or an additional host name that is resolved to the IP address of an existing host computer in the DNS namespace. For example, if you use the same computer as both a Web server and an FTP server, you may want to resolve both the WWW host name and the FTP host name to the same IP address. Using a CNAME, you can resolve both names to the same IP address.

To create a CNAME:
1.       Start the DNS snap-in.
2.       Click the DNS Server object for your server in the left pane of the console, and then expand the server object to expand the tree.
3.       Expand Forward Lookup Zones.
4.       Under Forward Lookup Zones, right-click the zone that you want (for example, example.com), and then click New Alias (CNAME).
5.       In the Alias name box, type the alias that you want. For example, type ftp.
6.       In the Fully qualified name (FQDN) for target host box, type the fully qualified host name of the host computer that you want. For example, type www.example.com, and then click OK.

How to Add an MX Record
An MX (or "Mail Exchanger") record is used to identify a host computer as a Simple Mail Transport Protocol (SMTP)/Post Office Protocol (POP3) server. To add an MX record, follow these steps. Note that you must first create the "A" record for the mail server host.
1.       Start the DNS snap-in.
2.       Click the DNS Server object for your server in the left pane of the console, and then expand the server object to expand the tree.
3.       Expand Forward Lookup Zones.
4.       Right-click the zone that you want (for example, example.com), and then click New Mail Exchanger (MX).
5.       In the Fully qualified domain name (FQDN) of mail server box, type the fully qualified domain name of the host computer that acts as the mail server. For example, type mail.example.com.
6.       Click OK.

How to Add a Name Server
To identify an additional name server:
1.       Start the DNS snap-in.
2.       Click the DNS Server object for your server in the left pane of the console, and then expand the server object to expand the tree.
3.       Expand Forward Lookup Zones.
4.       Under Forward Lookup Zones, right-click the zone that you want (for example, example.com), and then click Properties.
5.       Click the Name Servers tab, and then click Add.
6.       In the Server fully qualified domain name (FQDN) box, type the host name of the server that you want to add. For example, type namesvr2.example.com.
7.       In the IP address box, type the IP address of the Name server that you want to add (for example, type 192.168.0.22), and then click Add.
8.       Click OK, and then click OK to return to the DNS window.
9.       Expand Reverse Lookup Zones, right-click the zone that you want, and then click Properties.
10.   Click the Name Servers tab, and then click Add.
11.   In the Server fully qualified domain name (FQDN) box, type the host name of the server that you want to add. For example, type namesvr2.example.com.
12.   In the IP address box, type the IP address of the Name server that you want to add (for example, type 192.168.0.22), and then click Add.
13.   Click OK, and then click OK again to return to the DNS window.
For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/323417/ )
HOW TO: Integrate Windows Server 2003 DNS with an Existing DNS Infrastructure in Windows Server 2003
(http://support.microsoft.com/kb/323380/ )
HOW TO: Configure DNS for Internet Access in Windows Server 2003
For additional information about installing and configuring DNS, click the following article number to view the article in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/172953/ )
HOWTO: Populate DBGrid from Crosstab Parameter Query
(http://support.microsoft.com/kb/238797/ )
Microsoft DNS Server Installation and Configuration Document Available on Windows NT FTP Site

Browser Name:
Browser Version:
Browser Code Name:
User-Agent: