• RSS
  • Twitter
  • FaceBook

Welcome to ISAserver.org

Forums | Register | Login | My Profile | Inbox | RSS RSS icon | My Subscription | My Forums | Address Book | Member List | Search | FAQ | Ticket List | Log Out

msdetotxt.vbs request

Users viewing this topic: none

Logged in as: Guest
  Printable Version
All Forums >> [ISA Server 2004 Firewall] >> Logging and Reporting >> msdetotxt.vbs request Page: [1]
Login
Message << Older Topic   Newer Topic >>
msdetotxt.vbs request - 17.Jan.2005 3:22:00 PM   
emanuele.pola@centrocompu

 

Posts: 1
Joined: 17.Jan.2005
Status: offline
Hi all, i'm looking for that file but seem that isn't available also on Microsoft site.

Did someone know where to find it? Pls. don't tell me it's on the cdrom .. it isn't.

Best Regards

Emanuele
Post #: 1
RE: msdetotxt.vbs request - 17.Jan.2005 9:12:00 PM   
mnyquist

 

Posts: 34
Joined: 10.Sep.2003
From: Denver
Status: offline
I contacted MS about this, and the promised MSDEtoTXT.vbs does not exist.... I did write a quick script to do the trick for me, with the ultimate goal of converting it to WELF format so I could use my old WebTrends software. The dump works fine, but my convert program has issues. I could post that too if anyone wanted to help me work out the bugs... So - here's the script - it's built to be run in scheduler (have SQL tools loaded on the machine you're running from) - just modify the parameters at the top for:
FW= (your firewall name here)
LogComputer = "." (means THIS computer)
LogPath = (where on THIS machine to make the log files)
LogDrive = (which drive for the above logpath)

Once run, it will find all the ISA databases to dump, check to see if it has already dumped it (don't do it twice), and then dump...

'==========================================================================
'
' VBScript Source File -- Created with SAPIEN Technologies PrimalScript 3.1
'
' NAME:
'
' AUTHOR: Mark Nyquist , Spectrum Human Resource Systems Corp.
' DATE : 12/2/2004
'
' COMMENT:
'
'==========================================================================
fw="isa1\msfw"
LogComputer = "."
LogPath = "temp"
LogDrive = "c:"

'convert logpath to the stupid query format (double \\)
For zzz=1 To Len(logpath)
logpath1=logpath1 & Mid(logpath,zzz,1)
If Mid(logpath,zzz,1)="\" Then logpath1=logpath1 & "\"
Next

Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & LogComputer & "\root\cimv2")
Set objShell = WScript.CreateObject("WScript.Shell")
Set objFSO = WScript.CreateObject("Scripting.FileSystemObject")

Const adOpenStatic = 3
Const adLockOptimistic = 3
Const adUseClient = 3
Set objConnection = CreateObject("ADODB.Connection")
Set objRecordset = CreateObject("ADODB.Recordset")
objConnection.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=master;Data Source=" & fw
objRecordset.CursorLocation = adUseClient
objRecordset.Open "select name from master.dbo.sysdatabases where left(name,6) = 'ISALOG'",objConnection,adOpenstatic,adLockOptimistic

While Not objRecordset.eof
targetname = objRecordset("Name") & ".msde"
Set colFiles = objWMIService.ExecQuery ("Select * from CIM_Datafile where name = '" & logdrive & "\\" & logpath1 & "\\" & targetname& "'")

IF colfiles.count = 0 Then
targettable = objRecordset("Name") & ".dbo."
If InStr(objRecordset("Name"),"FWS") Then TargetTable = TargetTable & "FirewallLog"
If InStr(objRecordset("Name"),"WEB") Then TargetTable = TargetTable & "WebProxyLog"
objName = objFSO.GetTempName
objTempFile = objName
Set objExecObject = objShell.Exec("BCP " & TargetTable & " out " & logdrive & "\" & logpath & "\" & TargetName & " -S " & fw & " -T -c")
WScript.Echo "BCP'ing table to " & logdrive & "\" & logpath & "\" & TargetName
Do While Not objExecObject.StdOut.AtEndOfStream
strText = objExecObject.StdOut.Readline()
If InStr(strText, "total") > 0 Then
wscript.echo "Done with " & TargetTable
Exit Do
End If
Loop
Else
WScript.Echo logdrive & "\" & logpath & "\" & TargetName & " already exists. Skipping BCP"
End If

objRecordset.Movenext
Wend

WScript.Echo "Done"
Post #: 2

Page:   [1] << Older Topic    Newer Topic >>
All Forums >> [ISA Server 2004 Firewall] >> Logging and Reporting >> msdetotxt.vbs request Page: [1]
Jump to:

New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts