In the last couple of weeks I’ve been evaluating a number of different approaches/concepts for some upcoming MIM development projects. Some of these I’ve blogged about already.
Having an Identity Manager Metaverse with identity data is a key dependency to being able to validate ideas and concepts. So what’s a good source of some interesting and varied identity data with string, integer, reference, and boolean attributes? Twitter? Yeah why not. There’s an API. Should be pretty quick to get some sample data right?
In this blog post I’m going to give an overview of creating a PowerShell Twitter Management Agent to consume Twitter identities and their data into Microsoft Identity Manager. I’ll cover;
Here’s an overview of my approach/rationale of what data I was looking for and how I got it from Twitter;
Here is what a sample of some of the data looks like in the Metaverse.
You need to enable your Twitter Account for API access. Follow the details here
By now you should have downloaded the Twitter PowerShell API Modules and installed them. If you haven’t get WMF5 installed and run the install-module command as shown below in Line 1.
Modify the script below to give the;
….. and let it loose.
Now we have two XML files with a whole bunch of Twitter accounts and their metadata. There is an almost certainty that the seed account you’ve used is both followed by twitter accounts that you also follow. We’re going to need to remove the duplicates so that when we import the Twitter accounts into MIM we don’t have duplicates.
Basic, basic script to read in both files and spit out the unique Twitter Accounts is shown below.
Consuming data into the MIM Sync Engine obtained via PowerShell is quick and simple utilising Søren Granfeldt’s extremely versatile PowerShell Management Agent. I’m just going to cover importing the data from the XML file we generated above.
First up, you can get it from here. Søren’s documentation is pretty good but does assume you have a working knowledge of FIM/MIM and this blog post is no different.
A few items of note are;
Using the guidance above on the Granfeldt PSMA here are the two key scripts for the Twitter MA.
The Schema Script to expose the core Twitter identity attributes.
The Import Script that takes the rationalised XML file created earlier from the friends and followers queries and populates the connector space.
Required by the PSMA but not used as detailed earlier
Required by the PSMA but not used as detailed earlier
Path to the Schema Script in 8.3 format as detailed earlier.
Path to the Import, Export and Password scripts also in 8.3 format.
Select the attributes you want to bring in to the connector space.
Any Join logic, and a Projection Rule.
Import Flow Rules to bring in the Tweeters.
Create your Run Profiles, perform a Stage and Full Sync and BAM; Tweeters in the Metaverse. Real Word Identity Data Ahoy. Exception testing commences now.
Follow Darren on Twitter @darrenjrobinson
A few weeks back the Microsoft AI Tour was in Sydney Australia. There was a…
If you're anything like me you always have PowerShell open, and often both PowerShell and…
Decentralised Identity is a technology I'm passionate about and have written many posts and tools…
Over two years ago I authored a PowerShell Module that enabled the automation of 1Password.…
Buried in my PowerShell Snippets Vol 4 post from 2021 is the PowerShell script and…
Short post on how to recovery from "The Windows Subsystem for Linux instance has terminated"…
This website uses cookies.