i have a script that i am working with and i need the output file to be something like cert_computername.csv i have tried many suggestions and cant get it to work just right, currently it just outputs Certificates.csv
Option ExplicitDim oTransSet oTrans = CreateObject("Scripting.FileSystemObject")Dim oTransFSet oTransF = oTrans.OpenTextFile("Certificates.csv", 2, True)Dim objMMCSet objMMC = CreateObject("MMC20.Application")objMMC.ShowobjMMC.Load("\\servername\Certificates\certmgr.msc")Dim objDocSet objDoc = objMMC.DocumentDim objSNSet objSN = objDoc.ScopeNamespaceDim objRootSet objRoot = objDoc.RootNodeDim objEvtVwrNodeSet objEvtVwrNode = objSN.GetChild(objRoot)objSN.Expand(objEvtVwrNode)Dim objViewSet objView = objDoc.ActiveViewOn Error Resume NextDim objNodeSet objNode = NothingSet objNode = objSN.GetChild(objEvtVwrNode)If (objNode Is Nothing) then Wscript.echo "Unable to get Event Viewer child node, end of programm." Wscript.quitEnd IfDo Until (objNode Is Nothing) objSN.Expand(objNode) objView.ActiveScopeNode = objNode Dim BerDoss Set BerDoss = Nothing Set BerDoss = objSN.GetChild(objNode) Do Until (BerDoss Is Nothing) objSN.Expand(BerDoss) objView.ActiveScopeNode = BerDoss Dim objList Set objList = objView.ListItems Dim objItem For Each objItem In objList Dim str str = objView.CellContents(objItem, 1) If (str <> "Error") Then Dim vLigne Dim I vLigne = objNode.Name + " ; " + BerDoss.Name For I = 1 To 20 vLigne = vLigne + " ; " + objView.CellContents(objItem, I) Next oTransF.writeline vLigne End If Next Dim objSib2 Set objSib2 = Nothing Set objSib2 = objSN.GetNext(BerDoss) Set BerDoss = objSib2 Loop Dim objSib Set objSib = Nothing Set objSib = objSN.GetNext(objNode) Set objNode = objSibLoopoTransF.CloseMsgBox "finished certs"Wscript.quit
Set oTransF = oTrans.OpenTextFile("Certi
to this:
Set oTransF = oTrans.OpenTextFile("cert_