Check Directory Service log using a CMD Script

The following script checks the Directory Service log on domain controllers specified in a Servers.txt file or any other TXT file. The report format is in CSV and four authentication is supported by this script. You can run the script in different domains also.

1. Create a folder in C:\ drive DSLOG.

2. Download Psloglist.exe and Psexec.exe from Microsoft site and copy it to C:\DSLOG

3. Create a TXT file for servers.

@echo off

cls

setlocal enabledelayedexpansion

@echo *=======================================
@Echo * Script to Report Directory Service Log
@Echo * Author       : Nirmal Sharma
@Echo * Report Format: CSV or XLS
@Echo * Report Files : DSLOG.CSV (Full Report)
@Echo *              : Auth-DS.csv (Summary)
@Echo * Authentiction: Four Supported
@Echo * Different Dom: Yes
@Echo * Login Mode   : Built-in
@echo  =========================================================

@echo 1. Enter Server List…(e.i. C:\DSLOG\Servers.txt)
@echo ==========================================================
set /P srvlist=” “
@echo 2. Enter the number of previous days to search…(1 to 99)
@echo ==========================================================
set /P LogDays=
@echo 3. Only (1)-Warning, (2)-Error, (3)-Both…
@echo ==========================================================
set /P OnlyWE=

IF exist %srvlist% (
  Echo Server list found: %srvlist%
  Echo Processing all the servers from %srvlist%
  CLS

) ELSE (
  CLS
  Echo Server list NOT found: %srvlist%
  Echo Exiting…
  goto:EOF

)
  SET DC_NOT=
  SET Tot_War=
  SET Tot_Err=
  SET Int_Logon=
  SET ComERRAU=
  SET Auto_login=
  SET ComERRAuto=
  SET AU_Login=
  SET ServerStat=
  SET TKL_NEW=
  SET TKL_OLD=
  SET Rem_Req=
  SET PSEXEC_SPU=
  SET DST_Stat=
  SET AOS_Ver=
  SET AOS_Folder=
  SET AOS_Un=
  SET Final_login=
  SET ComERR=
  SET NewComERR=

set /a totsrv=0
set /a totcnt=0

FOR /F %%a in (%srvlist%) DO SET /a totsrv=!totsrv!+1

  SET Auto_login=
  SET DC_NOT=
  SET Tot_War=
  SET Tot_Err=
  SET ComERRAuto=
  SET ComERRAU=
  SET AU_Login=
  SET ServerStat=
  SET TKL_NEW=
  SET TKL_OLD=
  SET Rem_Req=
  SET AOS_Ver=
  SET AOS_Folder=
  SET AOS_Un=
  SET Final_login=
  SET ComERR=
  SET NewComERR=
  SET PS_Rem=

Title Directory Service log is in progress…

IF exist C:\DSLOG\Report.csv Del C:\DSLOG\Report.csv
IF exist C:\DSLOG\HostsAlive.txt Del C:\DSLOG\HostsAlive.txt
IF exist C:\DSLOG\HostsDown.txt Del C:\DSLOG\HostsDown.txt
IF exist C:\DSLOG\Alreadydone.txt Del C:\DSLOG\AlreadyDone.txt
IF exist C:\DSLOG\ToBeDone.txt Del C:\DSLOG\ToBeDone.txt
IF exist C:\DSLOG\RemovedDST.txt Del C:\DSLOG\RemovedDST.txt
IF exist C:\DSLOG\RemoveFailed.txt Del C:\DSLOG\RemoveFailed.txt
IF exist C:\DSLOG\PSFailed.txt Del C:\DSLOG\PSFailed.txt
IF exist C:\DSLOG\PSSuccess.txt Del C:\DSLOG\PSSuccess.txt
IF exist C:\DSLOG\Auth-DS.csv Del C:\DSLOG\Auth-DS.csv
IF exist C:\DSLOG\DSLOG.csv Del C:\DSLOG\DSLOG.csv

Echo Server Name, Up/Down, Login-1, Login-2, Login-3, Login-4, Final Login?,DC?, OS Version, Total Warning MSG, Total Error MSG >> Auth-DS.csv

Echo Log No, Log Name, Source, Type, Server, Date-Time, Event ID, Other >> DSLOG.CSV

FOR /F “TOKENS=*” %%a IN (%srvlist%) DO CALL:DONOW “%%a”

:DONOW

SET srvname=%~1

IF [%OldSrv%] == [] SET OldSrv=%srvname%

SET /a totcnt=%totcnt%+1

CLS

Echo 1.Processing Server: %srvname% Total Server:[%totcnt% Of %totsrv%] Last Server: %OldSrv%
Echo 2.Checking Connectivity……………

IF exist C:\DSLOG\pingresult.txt Del C:\DSLOG\pingresult.txt

Ping -n 1 %srvname% > PingResult.txt 2>&1

FIND /i “Reply From” < PingResult.txt > DoNotShow.txt 2>&1

IF %errorlevel% == 0 (
  SET ServerStat=UP

  Echo 3.Reply received from Host %srvname%
  Echo %srvname% >> HostsAlive.txt
  REM This is to check wether currently logged in user have access or not.

  IF exist C:\DSLOG\Access.txt Del C:\DSLOG\Access.txt
  IF exist C:\DSLOG\NoAccess.txt Del C:\DSLOG\NoAccess.txt

  Echo 4.Checking Access for Currently Logged on user on Server: %srvname%

  DIR \\%srvname%\C$ > Access.txt 2>&1
  FIND /i “File(s)” < Access.txt > DoNotShow.txt

  IF !errorlevel! NEQ 0 (

     FOR /F “Tokens=*” %%T In (‘Type Access.txt’) DO SET NewComERR=”%%T”

     IF exist C:\DSLOG\TKLold.txt Del C:\DSLOG\TKLold.txt

     Echo 5.Login 1 failed…checking Login 2

     NET USE T: /delete > DoNotShow.txt 2>&1
     NET USE T: \\%srvname%\c$ /user:TKLUser Password > TKLOld.txt 2>&1
     FIND /i “The command completed successfully.” < TKLold.txt > DoNotShow.txt 2>&1

     IF !errorlevel! NEQ 0 (
        Echo 6.Login 2 also failed…
        SET TKL_Old=Failed
        SET TKL_New=Failed
        SET Final_Login=Failed
        FOR /F “Tokens=*” %%T In (‘Type TKLold.txt’) DO SET ComERR=”%%T”
        IF exist C:\DSLOG\TRLogin.txt Del C:\DSLOG\TRLogin.txt

        Echo 5.Checking Login 3…

        NET USE T: /delete > DoNotShow.txt 2>&1
        NET USE T: \\%srvname%\c$ /user:Test\TKLUser Password > TRLogin.txt 2>&1
        FIND /i “The command completed successfully.” < TRLogin.txt > DoNotShow.txt 2>&1

        IF !errorlevel! NEQ 0 (

           Echo 7.Login 3 also failed…

           SET TKL_Old=Failed
           SET TKL_New=Failed
           SET AU_Login=Failed    
           SET Final_Login=Failed
           FOR /F “Tokens=*” %%T In (‘Type TRLogin.txt’) DO SET ComERRAU=”%%T”

           IF exist C:\DSLOG\Autologin.txt Del C:\DSLOG\AutoLogin.txt

           Echo 5.Checking Login 4…

           NET USE T: /delete > DoNotShow.txt 2>&1
           NET USE T: \\%srvname%\c$ /user:TestAutoING\user Password > AutoLogin.txt 2>&1
           FIND /i “The command completed successfully.” < AutoLogin.txt > DoNotShow.txt 2>&1
           IF !errorlevel! NEQ 0 (
              Echo 7.Login 4 also failed…

              SET TKL_Old=Failed
              SET TKL_New=Failed
              SET AU_Login=Failed    
              SET Auto_login=Failed
              SET Final_Login=Failed
              FOR /F “Tokens=*” %%T In (‘Type AutoLogin.txt’) DO SET ComERRAuto=”%%T”

           ) ELSE (

              SET ComERRAuto=
              Echo 7.Login 4 passed !…
              SET TKL_Old=Failed
              SET TKL_New=Failed
              SET AU_Login=Failed
              SET Auto_Login=Passed
              SET Final_Login=Passed
           )

        ) ELSE (

           SET ComERRAU=
           Echo 7.Login 3 Passed…
           SET TKL_Old=Failed
           SET TKL_New=Failed
           SET AU_Login=Passed
           SET Final_Login=Passed
        )

     ) ELSE (
        SET ComERR=
        Echo 6.Login 2 Passed…
        SET TKL_New=Failed
        SET TKL_old=Passed
        SET Final_Login=Passed
     )

  ) ELSE (
     SET NewComERR=

     Echo 5.Currently Logged on user have access…
     Echo 6.Login 1 Passed…

     SET TKL_New=Passed
     SET Final_Login=Passed
     SET TKL_Old=Not Checked
  )     
  IF !Final_Login! == Failed (
     SET DLS_B=
     SET BIAS_B=
     SET DLS_A=
     SET BIAS_A=
     SET TimeZone_N=
     SET PSEXEC_TZ=
     SET Rem_Req=
     SET AOS_Ver=
     SET AOS_Folder=
     SET AOS_Un=
     SET PSEXEC_SPU=
     SET Uninst_Fold=
     SET Os_Auto_E=

     Echo 5.Login Failed…user DON’T have access.
     Echo %srvname% >> NoAccess.txt

  ) ELSE (

     Echo 5.Currently Logged in user have access on C:\ drive.

     Echo 6.Check OS Version and Windows System Folder name…

     IF exist C:\DSLOG\Windir.txt Del C:\DSLOG\Windir.txt
     IF exist C:\DSLOG\UnFold.txt Del C:\DSLOG\UnFold.txt

     Psexec.exe \\%srvname% cmd.exe /c SET > Windir.txt 2>&1
     FIND /i “windir=C:\WINDOWS” < Windir.txt > DoNotShow.txt 2>&1
     IF !errorlevel! == 0 (
    SET AOS_Ver=”Windows 2003″

        Echo 6.OS Version: !AOS_Ver! 

     ) ELSE (
        SET AOS_Ver=”Windows 2000″
        Echo 6.OS Version: !AOS_Ver! 

     )

     Echo SERVER NAME: %srvname% >> DSLOG.CSV
     ECHO ========================== >> DSLOG.csv

     IF exist C:\DSLOG\DSLOG.txt Del C:\DSLOG\DSLOG.txt

     Echo 6.Checking Directory Service Log on Server…
     IF %OnlyWE% == 1 (
    psloglist \\%srvname% “Directory Service” -f w -s -d %LogDays% -x >> DSLOG.cSV
    psloglist \\%srvname% “Directory Service” -f w -s -d %LogDays% -x >> DSLOG.txt
     )
     IF %OnlyWE% == 2 (
    psloglist \\%srvname% “Directory Service” -f e -s -d %LogDays% -x >> DSLOG.cSV
    psloglist \\%srvname% “Directory Service” -f e -s -d %LogDays% -x >> DSLOG.txt
     )
     IF %OnlyWE% == 3 (
    psloglist \\%srvname% “Directory Service” -f we -s -d %LogDays% -x >> DSLOG.CSV
    psloglist \\%srvname% “Directory Service” -f we -s -d %LogDays% -x >> DSLOG.txt
     )

     Find /i “Could not locate the specified event log” < DSLOG.txt >> DoNotShow.txt

     if !errorlevel! == 0 (
    SET DC_NOT=NO
     ) ELSe (
    SET DC_NOT=YES
     )

     IF exist C:\DSLOG\TotWar.txt Del C:\DSLOG\Totwar.txt

     Find /c “WARNING” < DSLOG.txt >> TotWar.txt
     FOR /F “Tokens=*” %%a in (Totwar.txt) DO SET Tot_War=%%a

     IF exist C:\DSLOG\TotErr.txt Del C:\DSLOG\TotErr.txt
     Find /c “ERROR” < DSLOG.txt >> TotErr.txt
     FOR /F “Tokens=*” %%a in (TotErr.txt) DO SET Tot_Err=%%a

   )
) ELSE (

  SET ServerStat=Down

  Find /i “Request Timed” < PingResult.txt > DoNotShow.txt

  IF !errorlevel! == 0 (
     SET ServerStat=Request Timed Out
  ) ELSE (
     SET ServerStat=Uknown Host
  )

  SET TKL_NEW=
  SET TKL_OLD=
  SET DC_NOT=
  SET AOS_Ver=
  SET AOS_Folder=
  SET AOS_Un=
  SET Rem_Req=
  SET ComERR=
  SET NewComERR=
  SET PS_Rem=
  SET AU_Login=
  SET ComERRAU=
  SET Int_Logon=
  SET Tot_War=
  SET Tot_Err=
  SET Auto_login=
  SET ComERRAuto=

  Echo %srvname% >> HostsDown.txt
  Echo 3.Reply NOT received from Host %srvname%

)

SET OldSrv=%srvname%

IF [!srvname!] == [] (

  Echo Empty

) ELSE (

ECHO %srvname%, %ServerStat%, %TKL_NEW%, %TKL_OLD%, %AU_Login%, %Auto_Login%, %Final_Login%, %DC_NOT%, %AOS_Ver%, %Tot_War%, %Tot_Err% >> Auth-DS.csv

  SET ServerStat=Down
  SET DC_NOT=
  SET Final_login=
  SET TKL_NEW=
  SET Int_Logon=
  SET TKL_OLD=
  SET Rem_Req=
  SET AOS_Ver=
  SET AOS_Folder=
  SET AOS_Un=
  SET Rem_Req=Yes
  SET ComERR=
  SET NewComERR=
  SET PS_Rem=
  SET Tot_War=
  SET Tot_Err=
  SET AU_Login=
  SET ComERRAU=
  SET Auto_login=
  SET ComERRAuto=

)

:eof

How to refresh the Group Policy Settings on remote computers

The following knowledgebase explains the scenario in which you need to refresh the Group Policy Settings on a remote computer.

The Group Policy Settings are refreshed as per the interval configured in the Group Policy for client computers, member servers and domain controllers. You can use the following command line tools to refresh the Group Policy Settings on remote computer. You need to log on to the computer manually and then perform the action suggested below:

For Windows XP computers:

  • Gpupdate.exe /Target:User /force
  • Gpupdate.exe /Target:Computer /force

For Windows 2000 computers:

  • Secedit.exe /refreshpolicy user_policy
  • Secedit.exe /refreshpolicy machine_policy

To refresh the policy on remote computer or computers you can use the following script to do so:

  1. Create a ComputerList.txt
  2. Put all the remote computers in the Text file.
  3. Use the Psexec.exe tool to execute the command remotely.

For Windows XP Computers:

Psexec.exe -@ComputerList.txt Gpupdate.exe /Target:User /force

Psexec.exe -@ComputerList.txt Gpupdate.exe /Target:Computer /force

For Windows 2000 Computers:

Psexec.exe -@ComputerList.txt secedit.exe /refreshpolicy user_policy

Psexec.exe -@ComputerList.txt secedit.exe /refreshpolicy machine_policy

The above Psexec.exe command will run on all the computers specified in the ComputerList.txt.

You can also use the following script to check the version of Operating System and then issue the command:

@echo off

XPGPORef1=gpupdate.exe /Target:User /force

XPGPORef2=gpupdate.exe /Target:Computer /force

Win2kGPORef1=secedit.exe /refreshpolicy user_policy

Win2kGPORef2=secedit.exe /refreshpolicy machine_policy

For /f “Tokens=*” %%a in (ComputerList.txt) Do (

SET Comp_name=%%a

Ver.exe \\%comp_name% > Hostver.txt

Find /I “XP” < Hostver.txt > CheckCC.txt

IF %errorlevel% == 0 (

Psexec.exe \\%comp_name% Gpupdate.exe /Target:User /force

Psexec.exe \\%comp_name% Gpupdate.exe /Target:Computer /force

) ELSE (

Psexec.exe \\%comp_name% secedit.exe /refreshpolicy user_policy

Psexec.exe \\%comp_name% secedit.exe /refreshpolicy machine_policy

)

)

The above script will check the Operating System version by executing Ver.exe on remote computer and then run the appropriate commands to refresh the Group Policy Objects.

How to verify the Page File location through a script:

The following knowledgebase will explain the methods you can use to check the Location of Page File on local and remote computer.

To check on local computer:

You can use the following methods:

  1. Connecting to Remote Registry Service
  2. Using a script

The first method is easy but includes a lot of efforts. You can navigate to the following location in registry after connecting to remote registry:

HKLM\System\CurrentControlSet\Control\Session Manager\Memory Management

The above registry key includes the following values in right pane:

pagingfiles REG_MULTI_SZ c:\pagefile.sys 3131 3131

To check on a Remote Computer:

You can use the below script to check the Paging File location on a remote computer:

@echo off

Srvlist=C:\Temp\Srvlist.txt

Echo Computer Name, Paging File Location >> Result.csv

SET PF_Loc=

For /F “Tokens=*” %%a In (%srvlist%) Do (

Set Comp_name=%%a

Set RegQry=”\\%%a\HKLM\system\currentcontrolset\control\session manager\Memory management /v pagingfiles

REG.exe Query %RegQry% > CheckCC.txt

FOR /f “Tokens=3” %%b in (CheckCC.txt) Do SET PF_Loc=%%b

Echo %Comp_name, %PF_Loc% >> Result.csv

)

The above script will check remote computer for one registry entry for Paging File location and the results will be saved in a CSV format file.

How to check the Internet Explorer version on Remote Computer:

The following knowledgebase will explain the methods you can use to check the Internet Explorer version on local and remote computer.

To check settings on local computer:

You can use the following methods:

  1. Connecting to Remote Registry Service
  2. Using a script

The first method is easy but includes a lot of efforts. You can navigate to the following location in registry after connecting to remote registry:

HKLM\Software\Microsoft\Internet Explorer

The above registry includes the following values in right pane:

Version REG_SZ 6.0.2900.2180

To check on a Remote Computer:

You can use the below script to check the Internet Explorer version on a remote computer:

@echo off

Srvlist=C:\Temp\Srvlist.txt

Echo Computer Name, Internet Explorer Version >> Result.csv

SET IE_Ver=

For /F “Tokens=*” %%a In (%srvlist%) Do (

Set Comp_name=%%a

Set RegQry=”\\%%a\HKLM\Software\Microsoft\Internet Explorer” /v Version

REG.exe Query %RegQry% > CheckCC.txt

Find /i “Version” < CheckCC.txt > StringCheck.txt

FOR /f “Tokens=3” %%b in (CheckCC.txt) DO SET IE_Ver=%%b

Echo %Comp_name, %IE_Ver% >> Result.csv

)

The above script will check remote computer for one registry entries for checking Internet Explorer version and the results will be saved in a CSV format file.

How to check the Processor Vendor and MHZ speed on Remote Computer

The following knowledgebase will explain the methods you can use to check the Processor Manufacturer and MHz speed of the processor on local and remote computer.

To check on local computer:

You can use the following methods:

  1. Connecting to Remote Registry Service
  2. Using a script

The first method is easy but includes a lot of efforts. You can navigate to the following location in registry after connecting to remote registry:

HKLM\HARDWARE\DESCRIPTION\System\CentralProcessor

The above registry key includes the following values in right pane:

ProcessorNameString REG_SZ Intel(R) Core(TM) Duo CPU T2400 @ 1.83GHz

VendorIdentifier REG_SZ GenuineIntel

To check on a Remote Computer:

You can use the below script to check the Processor Vendor and MHz speed on a remote computer:

@echo off

Srvlist=C:\Temp\Srvlist.txt

Echo Computer Name, Processor Vendor Name, Processor Speed >> Result.csv

SET Proc_Vend=

SET Proc_speed=

For /F “Tokens=*” %%a In (%srvlist%) Do (

Set Comp_name=%%a

Set RegQry=”\\%%a\HKLM\HARDWRE\Description\system\CentralProcessor”

REG.exe Query %RegQry% > CheckCC.txt

Find /i “VendorIdentifier” < CheckCC.txt > StringCheck.txt

FOR /f “Tokens=3” %%b in (CheckCC.txt) DO SET Prov_Vend=%%b

Find /i “ProcessorNameString” < CheckCC.txt > StringCheck.txt

FOR /f “Tokens=3” %%b in (CheckCC.txt) DO SET Proc_speed=%%b

Echo %Comp_name, %Proc_Vend%, %Proc_Speed% >> Result.csv

)

The above script will check remote computer for two registry entries for Processor Vendor Name and Processor Speed and the results will be saved in a CSV format file.

How to make sure AutoCheck is enabled on Remote Computer

The following knowledgebase will explain the methods you can use to check the AutoCheck registry entry on local and remote computer.

To check on local computer:

You can use the following methods:

  1. Connecting to Remote Registry Service
  2. Using a script

The first method is easy but includes a lot of efforts. You can navigate to the following location in registry after connecting to remote registry:

HKLM\System\CurrentControlSet\Control\Session Manager

The above registry key includes the following values in right pane:

bootexecute REG_MULTI_SZ autocheck autochk *

To check on a Remote Computer:

You can use the below script to check the Processor Vendor and MHz speed on a remote computer:

@echo off

Srvlist=C:\Temp\Srvlist.txt

Echo Computer Name, Boot Check Enabled? >> Result.csv

SET Boot_Chk=

For /F “Tokens=*” %%a In (%srvlist%) Do (

Set Comp_name=%%a

Set RegQry=”\\%%a\HKLM\system\currentcontrolset\control\session manager” /v bootexecute

REG.exe Query %RegQry% > CheckCC.txt

Find /i “autocheck autochk” < CheckCC.txt > StringCheck.txt

If %errorlevel% == 0 (

SET Boot_Chk=Enabled

) ELSE (

SET Boot_Chk=Disabled

)

Echo %Comp_name, %Boot_Chk% >> Result.csv

)

The above script will check remote computer for one registry entry for Boot Check and the results will be saved in a CSV format file.

How to retrieve a list of shared folders shared using a script

The following knowledgebase will explain the methods you can use to check the shared folders shared on local and remote computer.

To check on local computer:

You can use the following methods:

  1. Connecting to Remote Registry Service
  2. Using a script

The first method is easy but includes a lot of efforts. You can navigate to the following location in registry after connecting to remote registry:

HKLM\System\CurrentcontrolSet\Services\Lanmanserver\Shares

The above registry key includes the list of shared folders in right pane.

To check on a Remote Computer:

You can use the below script to check the list of shared folders on a remote computer:

@echo off

Srvlist=C:\Temp\Srvlist.txt

Echo Computer Name, Shared Folders Lists >> Result.csv

SET Share_name=

For /F “Tokens=*” %%a In (%srvlist%) Do (

Set Comp_name=%%a

Set RegQry=”\\%%a\HKLM\System\CurrentcontrolSet\Services\Lanmanserver\Shares”

REG.exe Query %RegQry% > CheckCC.txt

FOR /f “Skip=4 Tokens=1” %%b in (CheckCC.txt) DO (

SET Share_name=%%b

Echo %Share_name% >> Result.csv

)

)

The above script will check remote computer for each registry entry in the right pane fto check the share name and the results will be saved in a CSV format file.

How to check and set Task Scheduler Log options and path using a script

The following knowledgebase will explain the methods you can use to check the Task Scheduler Log options and path on local and remote computer.

To check on local computer:

You can use the following methods:

  1. Connecting to Remote Registry Service
  2. Using a script

The first method is easy but includes a lot of efforts. You can navigate to the following location in registry after connecting to remote registry:

HKLM\Software\Microsoft\SchedulingAgent

The above registry key includes the following values in right pane:

LogPath REG_EXPAND_SZ %SystemRoot%\SchedLgU.Txt

TasksFolder REG_EXPAND_SZ %SystemRoot%\Tasks

To check on a Remote Computer:

You can use the below script to check the LogPath and Tasks Folder on a remote computer:

@echo off

Srvlist=C:\Temp\Srvlist.txt

Echo Computer Name, Log Path, Tasks Folder >> Result.csv

SET Log_Path=

SET Task_Fold=

For /F “Tokens=*” %%a In (%srvlist%) Do (

Set Comp_name=%%a

Set RegQry=”\\%%a\HKLM\Software\Microsoft\ShcedulingAgent”

REG.exe Query %RegQry% > CheckCC.txt

Find /i “LogPath” < CheckCC.txt > StringCheck.txt

FOR /f “Tokens=3” %%b in (CheckCC.txt) DO SET Log_Path=%%b

Find /i “TasksFolder” < CheckCC.txt > StringCheck.txt

FOR /f “Tokens=3” %%b in (CheckCC.txt) DO SET Task_Fold=%%b

Echo %Comp_name, %Log_Path%, %Task_Fold% >> Result.csv

)

The above script will check remote computer for two registry entries for Log Path and Tasks Folder and the results will be saved in a CSV format file.

How to check System BIOS Date and System BIOS Version on Remote computer

The following knowledgebase will explain the methods you can use to check the System BIOS date and BIOS Version on local and remote computer.

You can use the following methods:

  1. Connecting to Remote Registry Service
  2. Using a script

The first method is easy but includes a lot of efforts. You can navigate to the following location in registry after connecting to remote registry:

HKLM\HARDWARE\DESCRIPTION\System

The above registry includes the following values in right pane:

SystemBiosDate REG_SZ 04/30/07

SystemBiosVersion REG_MULTI_SZ LENOVO – 2130Phoenix FirstBIOS(tm) Notebook Pro

Version 2.0 for ThinkPadVer 1.00PARTTBL

To check on a Remote Computer:

You can use the below script to check the BIOS System date and BIOS Version on a remote computer:

@echo off

Srvlist=C:\Temp\Srvlist.txt

Echo Computer Name, BIOS Date, BIOS Version >> Result.csv

SET BIOS_Date=

SET BIOS_Ver=

For /F “Tokens=*” %%a In (%srvlist%) Do (

Set Comp_name=%%a

Set RegQry=”\\%%a\HKLM\HARDWRE\Description\system”

REG.exe Query %RegQry% > CheckCC.txt

Find /i “SystemBIOSDate” < CheckCC.txt > StringCheck.txt

FOR /f “Tokens=3” %%b in (CheckCC.txt) DO SET BIOS_Date=%%b

Find /i “SystemBIOSVersion” < CheckCC.txt > StringCheck.txt

FOR /f “Tokens=3” %%b in (CheckCC.txt) DO SET BIOS_Ver=%%b

Echo %Comp_name, %BIOS_Date%, %BIOS_Ver% >> Result.csv

)

The above script will check remote computer for two registry entries for BIOS System Date and BIOS Version and the results will be saved in a CSV format file.