Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy System Log

Status
Not open for further replies.

hooverd

Technical User
May 18, 2006
16
US
Good morning I need to script getting the System log from a print server "cscprnt" and copy it to a txt file on my Workstation "WS8582". Any idead?
Thanks hooverd
 
i think this is what you need:
Code:
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate,(Backup)}!\\" & _
        strComputer & "\root\cimv2")

Set colLogFiles = objWMIService.ExecQuery _
    ("Select * from Win32_NTEventLogFile where LogFileName='Application'")

For Each objLogfile in colLogFiles
    errBackupLog = objLogFile.BackupEventLog("c:\your_path\application.evt")
Next
 
Thanks but I can't get it to connect to server. It does create a file on my C: though.
Thanks
 
Hooverd,

You probably need to be logged in as an adminstrator while you were running the script.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top