0 votes

Hello!

I need to store all Adaxes log files to be able to inspect old logs and find out who performed certain operations. Can I back up log files?

by (150 points)

1 Answer

0 votes
by (216k points)

Update 2015

Adaxes logs are included into the configuration backup. For information on how to make a backup, have a look at the following help article: https://www.adaxes.com/help/BackupRestoreConfiguration.

Original

You can back up Adaxes log files using the following VB script:

AdaxesServiceHost = "localhost"
' If the username and password is Empty, the current user is used
Username = Empty
Password = Empty
' The parameter defines time period (in days since now) log records are backed up.
' If the parameter is 0 all records will be backed up.
NumberOfDaysToBackup = 0
' Contains file where log records will be written
BackupFilePath = "Backup.txt"

'Open the Adaxes namespace object
Set ns = GetObject("Adaxes:")
'Get the Adaxes service
Set admService = ns.GetService(AdaxesServiceHost, Username, Password)
'Get the ADsPath of the Service Log object
serviceLogPath = admService.Backend.GetConfigurationContainerPath("ServiceLog")
'Open the Service Log object
Set admServiceLog = admService.OpenObject(serviceLogPath, Username, Password, 0)
'Get the General log object
Set admGeneralLog = admServiceLog.GeneralLog
If NumberOfDaysToBackup <> 0 Then
    admGeneralLog.StartDateTime = DateAdd("d", -NumberOfDaysToBackup, Now())
    admGeneralLog.EndDateTime = Now()
End If
' Get log object
Set admLog = admGeneralLog.Log
Set admRecords = admLog.GetPage(0)
recordsCount = admRecords.Count
'Open the file and write all records into it
Set fso = CreateObject("Scripting.FileSystemObject")
Set textStream = fso.OpenTextFile(BackupFilePath, 2, True)
For index = 0 To recordsCount - 1
    Set admRecord = admRecords.GetObject(index)
    textStream.WriteLine "Start Time: " & admRecord.StartTime
    textStream.WriteLine "Completion Time: " & admRecord.CompletionTime
    textStream.WriteLine "Initiator: " & admRecord.Initiator.Name
    textStream.WriteLine "Target Object GUID: " & admRecord.TargetObjectGuid
    textStream.WriteLine "Operation Description: " & admRecord.Description
    textStream.WriteLine
Next

Related questions

0 votes
1 answer

I am somewhat new to my adaxes system but have been 'ramping up quickly' ... I noticed a week or so ago that querying my logs suddenly takes a LOT longer than it used to. ... performing that I might not be?? I'd appreciate any thoughts ... Thanks. - Scott W.

asked Aug 6, 2014 by hms.scott (220 points)
0 votes
1 answer

We performed the upgrade to Adaxes 2013 this weekend and this morning we noticed that the log retention changed back to 30 days, thus wiping out about 6 months of logging. If I retrieve the log file, is there a way to recover the log data out of it? Thanks

asked Aug 5, 2013 by jiambor (1.2k points)
0 votes
1 answer

Hi, is there possibility to search some custom string across all powershell script files used in Adaxes? I.e. Custom commands, Scheduled tasks etc I need to find out where is used some PowerShell command to be able to replace it for another one..

asked Apr 27, 2020 by KIT (910 points)
0 votes
1 answer

I am working on a custom deprovision task and have the need to delete a directory on a file server (not a profile directory) and cannot find a function in ... like the following path: \\servername\datafiles\hou\UserName\MyDocuments\* Thanks in advance.

asked Feb 9, 2015 by stuarts24 (50 points)
0 votes
1 answer

Hi, To make Adaxes fit in with other tools I wanted to change the text in the web ui for some options and have found the Strings resx files where some of this is ... "Basket" xml:space="preserve"&gt; &lt;value&gt;My List&lt;/value&gt; &lt;/data&gt; Thank you

asked Oct 13, 2014 by dazbo (390 points)
3,351 questions
3,052 answers
7,791 comments
545,079 users