An easy to use set of PowerShell wrapper scripts
This article outlines the features of the PowerShell scripts that are used as wrappers to the standard Anaplan Connect scripts. These PowerShell scripts will enable the following features:
A file watcher that waits for the arrival of files to start importing into Anaplan that can run through Enterprise Schedulers
Copy/move, import, and back up the source files as required after the Success or Failure of the import
Provide email notifications of the outcome of the processes
Can be used to trigger Actions on Anaplan that do not have file operations, but as required through schedulers
The scripts are avaliable in the links below.
Please contribute enhancements here: https://github.com/upaliw/anaplanconnect_ps
Latest releases for AC1.4 & AC1.3: https://github.com/upaliw/anaplanconnect_ps/releases
Contents of the ZIP file
The contents of the ZIP file are
Folder to hold the errors/messages generated from Anaplan Connect
Folder to hold the Java KeyStore file for CA Certificate authentication. See the complete Anaplan Connect Guide.
Folder that holds the required Java libraries to run Anaplan Connect
Folder to hold the logging information of the PowerShell scripts
Anaplan Connect script and Java package
The connection details for Anaplan (i.e. Basic Authentication or CA Cert details)
Main script that runs the various types of Anaplan Actions
Config file for all file-based operations
Main PowerShell scripts for all operations
Windows batch scripts that can be used to call the main PowerShell scripts through Enterprise Schedulers
Config file for email notification settings
Config file to hold the encrypted password for SMTP authentication
Step 1 – Anaplan Connect Authentication
The following file should be updated as required to denote the connection type to Anaplan. The connection can be either one of the two possible types:
Basic Authentication: Anaplan username and password, where the password is maintained by Anaplan and the Anaplan username is set to be an Exception user for SSO workspaces. The password will need to be reset every 90 days.
CA Certificate Authentication: A client certificate procured using a Certification Authority that is attached to the Anaplan Username (see the Administration: Security - Certificates article in Anapedia).
Step 2 – Email configuration
The following steps need to be completed for email notifications.
Update the EmailNotifications.ini file with the SMTP parameters.
As required, create the encrypted password file txt for the SMTP authentication. To use the default encryption of PowerShell the following command can be issued in the PowerShell prompt and redirect the output to a file as:
"smtpPassword" | ConvertTo-SecureString -AsPlainText -Force | ConvertFrom-SecureString | Out-File ".\EmailPassword.txt"Step 3 – File import configuration
Step 3 – File import configuration
This is the main configuration file for all the file import operations. The FileInterface.ini file will have the following information:
Mandatory: The main parameter passed to the scripts that picks all the details of the operations
Optional: The inbound filename as a Regular Expression, so that it can recognize any timestamps
Optional: The filename the Anaplan Action is tied to
Optional: The filename the file should be backed up as
Optional: The folder the file arrives to from a source system
Optional: The folder the file moves from the inbound location
Optional: The folder where the backups are located, which is by date-stamped subfolders
Command to run
Mandatory: The Anaplan Action
Optional: One of Success, Fail, or Both
Notify email addresses
Optional: The email addresses comma (,) separated
Mandatory: One of Import, Export, Process, Action, ImportAndProcess, JDBCImport, or JDBCProcess
Optional: Only for Export Action Type
JDBC Properties file
Optional: Only for JDBCImport and JDBCProcess Action Type
Mandatory: Workspace ID
Mandatory: Model ID
Calling the scripts
The scripts can be called manually or via an Enterprise Scheduler. The Key should be passed as the argument. The following scenarios can be provided as examples of these operations.
Wait for an arrival of a file, then import it to Anaplan
Run an Anaplan action per schedule
If an email notification is enabled per config entry, a sample with an attachment of any exceptions generated will look like:
Note: The email will contain 1 of 3 statuses
Success: No issues.
Success with data errors: Import was successful, but some data items had issues. There will be an attachment with the details of the exceptions generated from Anaplan.
Fail: The import failed, details will be attached in the email.
All steps of the interface processes will be logged in the logs folder for each operation (i.e. FileWatch, FileCopy, and FileRun) separately. The generated exceptions will be in the exceptions folder.
Note: There is no process to clean-up the older log files, which should be done on a case-by-case basis.
... View more
It would be quite useful to have a native function to define Valid Range for Number format in Line Items. This way we don't have to have another Line Item for checking or a Drop-down to select the numbers and then convert it to a number.
... View more
Hi, I have been able to get a certifcate and created a key_store file and was able to run imports into Anaplan using AC1.4. However, just wondering, is there a way to not show the key_store password in the batch file? The password is visible in plain text.
... View more
Thanks Chanveer... One more thing, if the Integration user is set as an exception user and we are going to use Basic Authentication. Will we need to change the password from time to time?
... View more
Hi, Just wondering, if we revert back to Basic Authentication, can we store the username and password encrypted in a file and then pass the encrypted strings to Anaplan Connect, if so how it that done? I would also want to know, will these integration accounts have to change their passwords according to the current poilicies? If so, then Basic Authentication doesn't seem like a viable option for customers that do not have any CA based setup in place.
... View more