//Build// Code on Weekend // Reach out if any one want to share cool FIM/MIM, IAM related Project. Mail : Any.Singha@gmail.com
Saturday, 12 June 2021
Wednesday, 8 July 2020
Rules in Sailpoint
Rules are the construct through which IdentityIQ allows the addition of
custom business logic at specific points within the execution flow of the
product.
The below is the sample how to construct business logic, There are
multiple application on-board to Sailpoint and the requirement is to get the
mail of the user from an specific application HR System – Employees.
The below are the learning
1. How can we define a method in Rule (A Java method is a collection of statements that are grouped together to perform an operation.)
2. Link of an identity
3. How to test the rule in IIQ console
1. How can we define a method in Rule (A Java method is a collection of statements that are grouped together to perform an operation.)
2. Link of an identity
3. How to test the rule in IIQ console
Code
import sailpoint.object.Identity;
import java.util.*;
import sailpoint.api.*;
import sailpoint.object.Link;
import java.util.*;
import sailpoint.api.*;
import sailpoint.object.Link;
// Java Method
public static String GetEmail(String user) {
Identity id = context.getObject(Identity.class,user);
List listOfLinks=id.getLinks();
if(listOfLinks!=null){
for(Link link : listOfLinks)
{
public static String GetEmail(String user) {
Identity id = context.getObject(Identity.class,user);
List listOfLinks=id.getLinks();
if(listOfLinks!=null){
for(Link link : listOfLinks)
{
if(link.getApplicationName().equals("HR System - Employees")){
String emailofApp = link.getAttribute("email");
return emailofApp;
}
}
}
String emailofApp = link.getAttribute("email");
return emailofApp;
}
}
}
}
String user = "Adam.Kennedy";
String emailofuser = GetEmail(user); // Calling the Method
System.out.println("We have found the email of the user"+ " "+ emailofuser);
String emailofuser = GetEmail(user); // Calling the Method
System.out.println("We have found the email of the user"+ " "+ emailofuser);
Save the above code in a Rule.
In IIQ Console.
In IIQ Console.
Thursday, 2 July 2020
How to get the value of other fields in a form in validation scripts.
I have two fields Location & sub-location and based on the value in location, the sublocation should allow to have the value from selected value from the lists and on having a different value in the field should give the customized message.
//validation variable comes in as 'value'
import sailpoint.tools.Message;
String Val = form.getField("Location").getValue();
System.out.println("Value is :" + Val);
List messages = new ArrayList();
String input = (String)value;
System.out.println("Value :" + input);
// Check===================================
if(Val.equals("India")) {
List loc = new ArrayList();
loc.add("Bangalore");
loc.add("Pune");
loc.add("Hyderabad");
int j=0;
for(String item : loc){
if( input.equals(item)){
j++;
}
}
if(j!=1) {
Message msg = new Message();
msg.setKey("Allowed value are Bangalore,Pune,Hyderabad");
messages.add(msg);
}
}
return messages;
Eg, Location India and corresponding sublocation is Bangalore,Hyderabad,Pune
The below rule can have multiple If statement, based on your requirement.
The below rule can have multiple If statement, based on your requirement.
//validation variable comes in as 'value'
import sailpoint.tools.Message;
String Val = form.getField("Location").getValue();
System.out.println("Value is :" + Val);
List messages = new ArrayList();
String input = (String)value;
System.out.println("Value :" + input);
// Check===================================
if(Val.equals("India")) {
List loc = new ArrayList();
loc.add("Bangalore");
loc.add("Pune");
loc.add("Hyderabad");
int j=0;
for(String item : loc){
if( input.equals(item)){
j++;
}
}
if(j!=1) {
Message msg = new Message();
msg.setKey("Allowed value are Bangalore,Pune,Hyderabad");
messages.add(msg);
}
}
return messages;
Thursday, 28 May 2020
Writing my first PlayBook on shell and local_action Module
Below is the structure of Playbook of generating HTML report using the shell and local_action Module
YAML
- hosts: localhost
tasks:
- name: checking
shell: |
a=$(hostnamectl | grep Chassis)
a=$a{a// /}
b=$(hostnamectl | grep "Icon name")
b=$b{b// /}
echo "<html>
<head>
<style>
table, th, td {
border: 1px solid black;
}
</style>
</head>
<body>
<h2>Ansible Generating report</h2>
<p>Author - Anirban.</p>
<table style="width:20%">
<tr>
<th>Name</th>
<th>Information</th>
</tr>
<tr>
<td>Chassis</td>
<td>$a</td>
</tr>
<tr>
<td>Icon name</td>
<td>$b</td>
</tr>
</table>
</body>
</html>"
register: output
- name: message
debug:
msg: "{{output.stdout}}"
- name: Generating the report
local_action: "copy content='{{output.stdout}}' dest=/home/anirban/Desktop/report.html"
Ansible Syntax check
ansible-playbook systemreport.yml --syntax-check
Ansible Playbook
ansible-playbook systemreport.yml
The outPut of the Playbook
Wednesday, 13 May 2020
Sunday, 29 March 2020
Null Object in Sailpoint IIQ
Time for me to go sleep, after working for almost 8 longs hours in Rules :) Stay Healthy and Safe.Covid - 19
Some time in Sailpoint IIQ we have to handle the Null object. It take sometime for me, how to handle the Null and it was always throwing the error message while running the Identity refresh.
Below is the example how to manage the Null object in Rule
import sailpoint.object.Identity;
String a = identity.getAttribute("Department");
if(a == null)
{
return "Null";
}
else if( a == "onepass") {
return "onepass";
}
else
{
return "Not one pass";
}
Java if..else..if statement.
Some time in Sailpoint IIQ we have to handle the Null object. It take sometime for me, how to handle the Null and it was always throwing the error message while running the Identity refresh.
Below is the example how to manage the Null object in Rule
import sailpoint.object.Identity;
String a = identity.getAttribute("Department");
if(a == null)
{
return "Null";
}
else if( a == "onepass") {
return "onepass";
}
else
{
return "Not one pass";
}
Java if..else..if statement.
if (expression1)
{
// codes
}
else if(expression2)
{
// codes
}
else if (expression3)
{
// codes
}
.
.
else
{
// codes
}
Thursday, 19 March 2020
Monday, 16 March 2020
How to add Owner to FIM Group (Powershell)
How to add display Owner to FIM Group (Powershell) , when the requirement is to add multiple owner from a txt file, the below is sample script which can be tweak.
<#-----------------------------------------------
Author : Anirban
----------------------------------------------- #>
If(@(Get-PSSnapin | Where-Object {$_.Name -eq "FIMAutomation"} ).count -eq 0) {Add-PSSnapin FIMAutomation}
$groupObject = Export-FIMConfig -customConfig "/Group[DisplayName = 'DisplayNameoftheGroup']" -Uri "http://localhost:5725" -OnlyBaseResources
$userObject = Export-FIMConfig -Uri http://localhost:5725 -onlyBaseResources -customConfig "/Person[DisplayName = 'DisplayNameoftheOwner']"
$importChange = New-Object Microsoft.ResourceManagement.Automation.ObjectModel.ImportChange
$importChange.Operation = 0
$importChange.AttributeName = "Owner"
$importChange.AttributeValue = $userObject.ResourceManagementObject.ObjectIdentifier
$importChange.FullyResolved = 0
$importChange.Locale = "Invariant"
$importObject = New-Object Microsoft.ResourceManagement.Automation.ObjectModel.ImportObject
$importObject.ObjectType = "Group"
$importObject.TargetObjectIdentifier = $groupObject.ResourceManagementObject.ObjectIdentifier
$importObject.SourceObjectIdentifier = $groupObject.ResourceManagementObject.ObjectIdentifier
$importObject.State = 1
$ImportObject.Changes = (,$ImportChange)
$importObject | Import-FIMConfig -Uri http://localhost:5725
<#-----------------------------------------------
Author : Anirban
----------------------------------------------- #>
If(@(Get-PSSnapin | Where-Object {$_.Name -eq "FIMAutomation"} ).count -eq 0) {Add-PSSnapin FIMAutomation}
$groupObject = Export-FIMConfig -customConfig "/Group[DisplayName = 'DisplayNameoftheGroup']" -Uri "http://localhost:5725" -OnlyBaseResources
$userObject = Export-FIMConfig -Uri http://localhost:5725 -onlyBaseResources -customConfig "/Person[DisplayName = 'DisplayNameoftheOwner']"
$importChange = New-Object Microsoft.ResourceManagement.Automation.ObjectModel.ImportChange
$importChange.Operation = 0
$importChange.AttributeName = "Owner"
$importChange.AttributeValue = $userObject.ResourceManagementObject.ObjectIdentifier
$importChange.FullyResolved = 0
$importChange.Locale = "Invariant"
$importObject = New-Object Microsoft.ResourceManagement.Automation.ObjectModel.ImportObject
$importObject.ObjectType = "Group"
$importObject.TargetObjectIdentifier = $groupObject.ResourceManagementObject.ObjectIdentifier
$importObject.SourceObjectIdentifier = $groupObject.ResourceManagementObject.ObjectIdentifier
$importObject.State = 1
$ImportObject.Changes = (,$ImportChange)
$importObject | Import-FIMConfig -Uri http://localhost:5725
Friday, 18 October 2019
Query by Context !!
In Sailpoint we can test our query rule in Sailpoint IIQ console.
Use the below template and create a new rule in Sailpoint IIQ in debug option.
The name of the rule is query and the other parameter created, id, modified will take by default after we create the rule.
In Sailpoint IIQ Console run the rule , rule "Query"
The below is querying all the last name of the identity in identity warehouse.
Thanks,
Anirban
Use the below template and create a new rule in Sailpoint IIQ in debug option.
The name of the rule is query and the other parameter created, id, modified will take by default after we create the rule.
In Sailpoint IIQ Console run the rule , rule "Query"
The below is querying all the last name of the identity in identity warehouse.
Thanks,
Anirban
Tuesday, 1 January 2019
Sailpoint Application Rule
Application Rule : The data in the source is not always in proper format and there is always a need how to have the data in the format in which the business want. In Identity IQ we can manipulate the data while doing the aggregation from the source with the help of Application Rule.
In Source Mapping, Add Source, Select the Application Rule, From the Application drop down select the Application and create the Rule.
To give an example, the ABC company want the Xlocation attribute in IQ to have the format firstname,lastname append with Microsoft.
Global Settings --> Identity Mapping , Select the attribute
In Source Mapping, Add Source, Select the Application Rule, From the Application drop down select the Application and create the Rule.
1. Give the Name of the Rule
2.The bean code which append "Microsoft" to firstname,lastname
Run the Aggregation task and do a IdentityCube Refresh and verify the Xlocation attribute in Identity Warehouse.
Sunday, 26 August 2018
SailPoint : Branding
I was going through a demo and architect of SailPoint IQ having login page with company logo.
It is not difficult to customized the UI in Sailpoint if you have the access to compass.
I was wondering how to do it without having a compass account.
Here is how you can do it
Place your image in folder apache-tomcat-8.5.24\webapps\identityiq\ui\images
I have placed my own photo :)
I have placed my own photo :)
Sunday, 22 July 2018
SAILPOINT: provisioning in Active Directory
SAILPOINT : This is project which is pursue side projects outside FIM/MIM/Azure AD connect..
After configuring or on board the Active Directory Application, the next we want how to proviosnnig a new user in AD from Identity warehouse.I wanted to do this from quite some time.
This is not the best way to provisioning user in AD, however it will show what need to be done at basic level in provisoning, To be honest i find it very hard as I do not see much explanation and steps need to do it available in open forum.
We will create two role 1) Entitlement 2 ) Business , these two role will help in understanding what need to be done, if we want to set up a real and complex provsioning in AD.
Navigate to "Setup" from drop down list select Roles.
Click on New Roles and select role
In Role Editor, select the Type "Entitlement".
Scroll down the page
In Entitlements, click ADD and select the application Active Directory.
From the option Add An Entitlement, select Group Membership and select the group,save and submit it.
Next follow the above steps and create a role with Business type.
In Assignment Rule. select Match List , Add Identity Attributes, In select Attribute we can select the attribute from Identity warehouse.In general we can select attribute tagged to multiple user, In this for example we want to provisioing a single user based on first name.
We have select the first name "Anne" and add the entitlement created above in it and submit it.
Navigate to task and run the refresh Identity cube and it will generate a form where we have to give the details of DN, sAMAccountName and password , After submitting the form the user will be provisioning in AD.
In Next Blog we will provisioning the user in AD without submitting the form.
After configuring or on board the Active Directory Application, the next we want how to proviosnnig a new user in AD from Identity warehouse.I wanted to do this from quite some time.
This is not the best way to provisioning user in AD, however it will show what need to be done at basic level in provisoning, To be honest i find it very hard as I do not see much explanation and steps need to do it available in open forum.
We will create two role 1) Entitlement 2 ) Business , these two role will help in understanding what need to be done, if we want to set up a real and complex provsioning in AD.
Navigate to "Setup" from drop down list select Roles.
Click on New Roles and select role
In Role Editor, select the Type "Entitlement".
Scroll down the page
In Entitlements, click ADD and select the application Active Directory.
From the option Add An Entitlement, select Group Membership and select the group,save and submit it.
Next follow the above steps and create a role with Business type.
In Assignment Rule. select Match List , Add Identity Attributes, In select Attribute we can select the attribute from Identity warehouse.In general we can select attribute tagged to multiple user, In this for example we want to provisioing a single user based on first name.
We have select the first name "Anne" and add the entitlement created above in it and submit it.
Navigate to task and run the refresh Identity cube and it will generate a form where we have to give the details of DN, sAMAccountName and password , After submitting the form the user will be provisioning in AD.
In Next Blog we will provisioning the user in AD without submitting the form.
Saturday, 10 June 2017
Static classes in Powershell
Static in PowerShell is calling a method without creating
instance of the object.
In Powershell it not always mandatory to create new function, there are many existing .Net build function can be used.
In Powershell it not always mandatory to create new function, there are many existing .Net build function can be used.
Eg. [Math] class
PS C:\> [math]::Sqrt(4)
2
To see all the static method associated with the class
PS C:\> [math] | gm -Static
Happy Learning
Sunday, 19 March 2017
Powershell Script Security.
Sometime the script will not pass through the Compliance as you have hard coded the password information of account in the script and any one who have the access to the server can use it with GOD mode access, Many times to come out of the situation converted my scripts to exe and deployed it in Production, However there is a drawback know one cannot debug the scripts and about the functionality.What if you not there in the company anymore,It will be a nightmare to team who is managing it.
There is one way I am writing it here without converting the script to exe, however it is not a full proof security ,but to some extent you can hide the password information from the user.
Thanks ..
There is one way I am writing it here without converting the script to exe, however it is not a full proof security ,but to some extent you can hide the password information from the user.
Thanks ..
Saturday, 4 March 2017
.. Year 2017
# I do not have my resolution yet this year, may be I am in comfort Zone
I have to kick my ass and start working.
This year we are going to see a lot of transformation, It's good for all IT guys start embracing cloud technology.
I set my Goals today.
Azure AD connect.
Learn C# Programming
Azure
Office 365
Anirban
---------------------------------------------------------------
I have to kick my ass and start working.
This year we are going to see a lot of transformation, It's good for all IT guys start embracing cloud technology.
I set my Goals today.
Azure AD connect.
Learn C# Programming
Azure
Office 365
Anirban
---------------------------------------------------------------
Thursday, 29 December 2016
Window Azure AD Connector : Group Membership.
Group membership of
on-premise not sycing to Office 365.
Sometime the
membership to the group on-premise will not match to the number of membership
to the group in O365. There could be numerous reason the number will not match,
are all the member to the group on-premise present in Azure AD ?
If all the member to
the group are present in Azure AD and still not member to the group in O365. check
the membership of the group in Azure AD and in EXO.
Determine the group
member count in Azure AD
1. Connect
to MSOL (connect-msolservice)
2. Run get-msolgroup
-searchstring "GroupName" | foreach {(Get-MsolGroupMember
-GroupObjectId $_.objectid.guid).count}
Determine the group
member count in EXO
1. Connect
to Exchange online shell
https://technet.microsoft.com/en-us/library/jj984289
https://technet.microsoft.com/en-us/library/jj984289
2. Run (Get-DistributionGroupMember
"GroupName").count
If
the count is different, there is no option left with us to fix it,Raise
a case with Microsoft and they will sync the group membership at backend.
Happy New Year to All .
Happy New Year to All .
Sunday, 9 October 2016
FIM 2010 R2 to MIM 2016 InPlace Upgrade [ excluded service and portal ]
As most of our FIM infrastructure is in Server 2008 R2, It always a business decision whether we are doing in place upgrade or migrate it over to totally new Server 2012.
FIM 2010 R2 to MIM 2016 InPlace Upgrade [ excluded service and portal ]
1. Snapshot of VM
2. Back up of your database
3. .Net framework of 4 or higher is supported by MIM, if it is not there make sure it is upgraded to 4 or higher version.
4. Change the compatibility level of SQL to 100 using SQL Management Studio.
5. Backup the encryption key
It is very important to back up the encryption key if you plan to use the existing database. The reason for this is that the server configuration, extension DLLs and other vital information is stored in the database. It will make life much easier in your migration upgrade.
6. Backup the extensions folder
This is not absolutely necessary unless you plan to start with a clean database. The extension DLLs are actually stored in the backend database as well as the extensions folder. If you backed up the encryption key before moving or restoring the existing database from FIM, then these DLLs will be re-populated into the extensions folder.
If for some reason you do not see the DLLs, then utilize your backup of the previous extensions folder to repopulate your Extensions.
7. Backup the source code.
Nowhere it is mentioned to uninstall the FIM , if you are doing a inplace upgrade you have to uninstall the FIM from Control Panel\All Control Panel Items\Programs and Features.
Once the FIM software uninstalled restart the server.
Navigate to the location of the Installation files for MIM 2016 Synchronization Service and begin the installation.
While installing point your SQL server instance to FIM Synchronization database of FIM and steps are same like FIM installation however the installer will discover the FIMSynchronization database and asked for the encryption key.After entering the Key it will start rebuilding your index and FIM will upgrade to MIM.
Please do test all your logic and upgradation in Test before moving to production.
All the Best..!!
FIM 2010 R2 to MIM 2016 InPlace Upgrade [ excluded service and portal ]
1. Snapshot of VM
2. Back up of your database
3. .Net framework of 4 or higher is supported by MIM, if it is not there make sure it is upgraded to 4 or higher version.
4. Change the compatibility level of SQL to 100 using SQL Management Studio.
5. Backup the encryption key
It is very important to back up the encryption key if you plan to use the existing database. The reason for this is that the server configuration, extension DLLs and other vital information is stored in the database. It will make life much easier in your migration upgrade.
6. Backup the extensions folder
This is not absolutely necessary unless you plan to start with a clean database. The extension DLLs are actually stored in the backend database as well as the extensions folder. If you backed up the encryption key before moving or restoring the existing database from FIM, then these DLLs will be re-populated into the extensions folder.
If for some reason you do not see the DLLs, then utilize your backup of the previous extensions folder to repopulate your Extensions.
7. Backup the source code.
Nowhere it is mentioned to uninstall the FIM , if you are doing a inplace upgrade you have to uninstall the FIM from Control Panel\All Control Panel Items\Programs and Features.
Once the FIM software uninstalled restart the server.
Navigate to the location of the Installation files for MIM 2016 Synchronization Service and begin the installation.
While installing point your SQL server instance to FIM Synchronization database of FIM and steps are same like FIM installation however the installer will discover the FIMSynchronization database and asked for the encryption key.After entering the Key it will start rebuilding your index and FIM will upgrade to MIM.
Please do test all your logic and upgradation in Test before moving to production.
All the Best..!!
Friday, 9 September 2016
FIM/ MIM Integration | ServiceNow MA
This article can be
refer as reference only, how can you build your first Management Agent connect
to Service Now. The samples code show how to call the Service Now
REST API from ECMA 2.0
The table for users is sys_user in Service Now or get the
details of table from service now developer.
Service Now API exchange the information in form of JSON (Java Script Object Notation)
To parse JSON object
in C#, use the Newtonsoft JSON library http://www.newtonsoft.com/json
The Code, please make your own adjustment according to your need,
Monday, 5 September 2016
Saturday, 13 August 2016
Asp.Net Web Service Application in Visual Studio 2015
It took some time to figure me out how to use the webservice in Visual Studio 2015, So blogging it here...
via GIPHY
ASP.NET Web Service Application project template is not available for .Net framework 4.0, however, available for .Net Framework 3.5.
via GIPHY
ASP.NET Web Service Application project template is not available for .Net framework 4.0, however, available for .Net Framework 3.5.
Subscribe to:
Posts (Atom)
-
This article can be refer as reference only, how can you build your first Management Agent connect to Service Now. The samples code show...
-
Rules are the construct through which IdentityIQ allows the addition of custom business logic at specific points within the execution fl...
-
Note : This series is for the Beginner and trouble shooting the Error With Sync Engine, Based on Test Lab, Highly advice do not do Full Syn...














