This is my first time here, hello all - I have a batch login script that works really well, but I am trying to find out how to get the serialnumber of the PCs within my network using the wmic bios get serialnumber cmd but I am not sure how to implement this into my script, please see script below:
Code: Select all
set ip_address_string="IPv4 Address"
for /f "usebackq tokens=2 delims=:" %%f in (`ipconfig ^| findstr /c:%ip_address_string%`) do (
@(Echo Event,Date,Time,Device,User,IP & Echo Login,%DATE%,%TIME:~0,8%,%COMPUTERNAME%,%USERNAME%,%%f))1>%RANDOM%.csv
goto :eof
Login,20/06/2021,11:27:44,LT6880,testuser, 192.168.0.86
If possible could I incorporate the wmic bios get serialnumber in my script so I could get the following output: Event,Date,Time,Device,User,IP,SN
Login,20/06/2021,11:27:44,LT6880,testuser, 192.168.0.86,Bsuggesting 4P4MW2
If anyone could point me in the correct direction that would be much appreciated. Also this is a login script by adding the wmic bios get serialnumber to the script will this slow down the login? - open for suggesting other than wmic bios get serialnumber cmd.
Many Thanks
John