Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

A typical case scenario is having security/compliance policies that enforce user account deactivations on specific platforms, like Jira, whenever a user account's last login reaches a specific aging (days from the current date the user account hasn't logged in to Jira)

Using Customers can automate this task using PS and SIL routines (scripting), a customer can automate this task.

\uD83D\uDCD8 Instructions

Info

IMPORTANT: This how-to procedure assumes the customer has successfully exported the user’s account information from Jira, including the account username and last login fields, into a CSV (comma-separated values) file.

...

Code Block
breakoutModewide
struct Login { // Login struct created to handle CSV file data
  string username;
  string last_login;
}

Login [] fileContent = readFromCSVFile("users.csv", true); // CSV file reading process

for (Login l in fileContent) {
    date last_login = parseDate("MM/dd/yyyy", l.last_login); // Date conversion from CSV file
    
    if (last_login < (currentDate() - "90d")) { // Checking user account aging status
        runnerLog("Last login on " + last_login);
        runnerLog(l.username); runnerLog("Aged account: true");
        boolean deactivated = admDeactivateUser(l.username); // User account is aged, so deactivation is attempted
        if (deactivated) { // User account deactivation was successful
            runnerLog(l.username); runnerLog(" - User account deactivation was successful");
        }
        else { // User account deactivation couldn't be performed
            runnerLog(l.username); runnerLog(" - User account deactivation was unsuccessful");
       }
    }
    else {
        runnerLog("Last login on " + last_login);
        runnerLog(l.username); runnerLog("Aged account: false");
    }
}

Script execution (output example):

image-20240405-145029.pngImage Added

Filter by label (Content by label)
showLabelsfalse
max5
spacescom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@bc3e0baf
sortmodified
showSpacefalse
reversetrue
typepage
cqllabel in ( "sil_code" , "sil_script" , "sil" , "silmanager" , "power-scripts" , "power_scripts" ) and type = "page" and space = "SUPPORT"
labelskb-how-to-article