🔥 500+ people already subscribed. Why not you? Get our newsletter with handy code snippets, tips, and marketing automation insights.

background shape
background shape

Retrieve Login Info Without Server Access

Sometimes you might be tasked with finding when a particular operator logged into the Adobe Campaign Classic rich client, even if you do not have access to the actual application server.

Here is a simple JavaScript snippet that allows you to explore the ‘logins.log’ file and more. I wanted to know whether a particular user has logged into the server in the past. I can see that ‘logins.log’ only retains a year’s worth of data.

///neolane/nl6/var/your_application_instance_name

var file = new File("logins.log")
file.open();
var pattern = "opertor.name"; 
// Create a RegExp object using the pattern


var regex = new RegExp(pattern, "gi"); // 'gi' for case-insensitive and global matching
for each(var line in file)
  if(regex.test(line)) logInfo(line)
file.close()
  1. File Initialization: new File("logins.log"). You can take a look at the example code on the JSAPI documentation
  2. Open file: file.open() This method opens the file for reading. It is necessary to open a file before you can read from or write to it.
  3. Regular expression setup: Here, a regular expression pattern is defined to search within the file. The RegExp object is initialized with this pattern and the "gi" flag for global case-insensitive search.
  4. File processing: This loop iterates through each line of the file. For each line, it checks if the line matches the regular expression. If it matches, it logs the line using logInfo(line) to the workflow’s journal.
  5. Close file: file.close() After all lines are processed, the file is closed to free up system resources.

Oh hi there 👋
I have a SSJS skill for you.

Sign up now to get an SSJS skill that can be used with your AI companion

We don’t spam! Read our privacy policy for more info.

Share With Others

The Author
Marcel Szimonisz

Marcel Szimonisz

MarTech consultant

I specialize in solving problems, automating processes, and driving innovation through major marketing automation platforms, particularly Salesforce Marketing Cloud and Adobe Campaign.

Your email address will not be published. Required fields are marked *

Buy me a coffee
Subscribe

Get exclusive tips, scripts and news

Choose your topics

We don’t spam! Read our privacy policy for more info.

Similar posts