vbscript - Need to log a script execution on users machine -
'set net = createobject("wscript.network") set fso = createobject("scripting.filesystemobject") logfile = "\\\\ja-rfzitd\instdir\000 sephora - uat\rpas_implementation\logfile\" & net.username & "_" & net.computername & ".log" set f = fso.opentextfile(logfile, 8, true) f.writeline "script executed at" & f.writeline "the user name " & net.username & " f.writeline "the netbios name " & net.computername &" f.close'
can check , allow me know if correct.
you create individual logfile per user , computer:
set net = createobject("wscript.network") set fso = createobject("scripting.filesystemobject") logfile = "\\server\share\" & net.username & "_" & net.computername & ".log" set f = fso.opentextfile(logfile, 8, true) f.writeline "information want log" f.close
vbscript
No comments:
Post a Comment