Hi
does anyone have an example of an "audit" batch file ? I need to capture machine name, user name, drive mappings, print queues etc
thanks
Printable View
Hi
does anyone have an example of an "audit" batch file ? I need to capture machine name, user name, drive mappings, print queues etc
thanks
Hello cscsi and welcome to Windrivers forum
You should do something like this - create a login script containing a bat file .
Create a share with write permissions for all the users on the server (\\servername\share)
on the batch file write:
@echo off
Echo new computer Entry >>\\servername\share\logger.txt
echo %date%-%time% >>\\servername\share\logger.txt
Echo %username% >>\\servername\share\logger.txt
Echo %computername% >>\\servername\share\logger.txt
Echo net use >>\\servername\share\logger.txt
cscript c:\windows\system32\prndrvr.vbs -l >>\\servername\share\logger.txt
The last line (printer information) generates a lot of lines (depends on number of printers).
You can also do this for a specific user by using (if you want for machine use %computername%):
@echo off
del \\servername\share\%username%.txt
Echo new computer Entry >>\\servername\share\%username%.txt
echo %date%-%time% >>\\servername\share\%username%.txt
Echo %username% >>\\servername\share\%username%.txt
Echo %computername% >>\\servername\share\%username%.txt
Echo net use >>\\servername\share\%username%.txt
cscript c:\windows\system32\prndrvr.vbs -l >>\\servername\share\%username%.txt
Good Luck,
Gabriel