How to get the complete list of whitelisted IPs? | Adobe Campaign Classic (v6/v7)

Today for one of my implementations, I had to get the list of all the whitelisted IP’s from 8 different instances.

I logged into the 1st instance and copied all the IP’s and did the same with the 2nd instance as well. Then I thought, let’s have had some fun and do this task in a different way. I came up with a good trick.Let me teach you this trick.

You can use this trick to do a lot of things and the below use case should get you started. Let’s deep dive now.

Goal: To get the complete list of whitelisted IPs

Follow the below steps.

Step 1:

Create a workflow that has the 3 activities in the order. (  Start- JS activity – End )

adobe-campaign-js-whitelist-ip-list-1

Step 2:

Add Javascript Code activity and paste my JS code in it.

/*
Implementation: To get the complete list of whitelisted IPs
Version: 2.0
Date: 12/06/2018
Author: Prajwal Shetty
*/

var file = new File( "/usr/local/neolane/nl6/conf/config-" + Application.instanceName + ".xml" );
var arr = [];
file.open()
for each(var line in file)
{
  arr.push( line )
}

for ( var i = arr.length - 1; i >= 0; i-- )
  logInfo(arr[i]);
 
file.close()

Step 3:

Run the workflow and check the audit logs. You will get the complete contents of your serverconf.xml. From this, you can get the IP’s that have been whitelisted for your instance.

adobe-campaign-js-whitelist-ip-list-2

That was fun right!

Remember this script can be used in a lot of use cases.

Hope this helps.

error: Content is protected !!