Sample script for deleting multiple sessions
You can use Find Sessions to delete multiple sessions manually from the command line or using Windows Task Scheduler to automate the task. However, if you are deleting multiple sessions at once, you might want to execute the command from a batch file to ensure that Find Sessions will wait for the operation to complete and return the result of the operation.
The following is a sample script to delete sessions from TestInstallation
recorded in the current month.
----------Start of FindSessions_Delete.bat---------- @ECHO OFF cd "C:\Program Files\Centrify\Audit\AuditAnalyzer" Start /WAIT FindSessions.exe /i="TestInstallation" /a="1 time is in this month" /delete if ERRORLEVEL 1 (goto FindSessionError) goto Succeeded :FindSessionError echo ########################################################################## echo ## FindSession execution failed. ErrorLevel: %ERRORLEVEL% ## echo ########################################################################## goto exit :Succeeded echo FindSession execution succeeded. :exit ----------End of FindSessions_Delete.bat----------
You can use a similar batch file if you want to export multiple sessions at the same time. To write a script for exporting information, you would specify the type of information to export and the path for saving the exported output. For example, if you want to export UNIX commands for MyInstallation
to the C:\UNIX
folder, the script could include a command like this:
Start /WAIT FindSessions.exe /i="MyInstallation" /export=”UnixCommand” /path=”C:\UNIX”