Import objects from Azure AD (AAD)
As many of the services in Azure, Azure Active Directory (AAD) is easiest to work with in an automated way is with PowerShell, the Microsoft Graph PowerShell SDK and the module Easit.GO.Webservice.
Prerequisites
- Microsoft PowerShell 7
- The Microsoft Graph PowerShell SDK
- The Easit.GO.Webservice PowerShell module.
Install the Microsoft Graph PowerShell SDK
Microsoft has an excellent guide for this here.
Get started with the Microsoft Graph PowerShell SDK
Microsoft has, yet again, an excellent guide for this here.
Install Easit.GO.Webservice
The PowerShell modules for Easit GO WebAPI is published to the PowerShell Gallery so the easiest way to install is by running Install-Module -Name Easit.GO.Webservice
Prepare Easit GO to receive objects
When you have successfully connected to Azure AD with the Graph SDK we can proceed with the necessary configuration needed in Easit GO. These steps require you to have a design license or a user that have completed our Integration training.
- Login to Easit GO.
- Click on the cog in the top right corner.
- Type import handler and click on the result.
- Click Add.
- Give it a name.
- Give it a description explaining what the import handler should do.
- Set a simple but clear identifier, for example azureContacts.
- Click on + to the right, on the same row as Import actions.
- In the popup, type contact as the name, select Import item as the import action and then click OK.
- Click on the cog for the same row as 1. @ contact.
- Change the value for Module to Contact.
- In the "Search section", add a unique mapping by clicking on the +, choose E-mail and click Add.
- Type the property name to Mail, this tells the import handler that it should find any existing contacts in Easit GO with the value for the attribute Mail from Azure AD.
- In the "Create section", choose an Item type (most likely Contact) and then you add all the mappings you would like to have. Property is the property name from Azure and field is the field in Easit GO that the value should go in.
- When you feel that you have some basic mapping done, click OK and then Save.
If you do not have an API-key for Easit GO you can generate one by backing out of the configuration section for import handlers and then type api where you typed import handler in step 3.
You can read more about Import handlers here.
Create / Update PowerShell script
A basic script that will connect to the Microsoft Graph API, get all users and then send them to Easit GO could look like this. In this example we are using app-only access via client credential with a certificate.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
|