Could anyone please point me in the right direction. The code below is part of an agent which I have scanning through logs for when the user last logged in etc. The problem I have is at the moment the agent references a Profile document to check what server it should scan the logs on. I want to make this dynamic and remove the need for the profile document. As you can see below the ForAll statment references a profileDoc.ServerLOGsToScan. I would like to change this to use session.servername so it will get the current server name instead of the profiledoc. Does anyone have any ideas?
Thanks Steve
Sub Initialize
Call InitializeVariables
Call InstantiateObjectVariables
Forall Server In profileDoc.ServerLOGsToScan
Set logdb = Nothing
Set logdb = session.GetDatabase(Server,"LOG.NSF")
If Not logdb Is Nothing Then
Set logview = logdb.GetView("Miscellaneous Events")
Call logview.Refresh
Set logdoc = logview.GetLastDocument
MoreToProcess = True
While (Not logdoc Is Nothing) And (MoreToProcess)
MoreToProcess = ProcessLogDoc(Server)
Set logdoc = logview.GetPrevDocument(logdoc)
Wend
End If
End Forall
Forall UserName In UsersNotInNABList
Call usersNotInNAB.AppendText(Listtag(UserName))
Call usersNotInNAB.AddNewLine(1)
End Forall
Call reportDoc.Save(True, False)
End Sub