Skip to content

Instantly share code, notes, and snippets.

@darrenjrobinson
Last active November 17, 2018 20:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darrenjrobinson/d20b478cca19e108b7f68834595d40b2 to your computer and use it in GitHub Desktop.
Save darrenjrobinson/d20b478cca19e108b7f68834595d40b2 to your computer and use it in GitHub Desktop.
Microsoft Identity Manager PowerShell Management Agent for Twitter. Supporting blog post here https://blog.darrenjrobinson.com/a-twitter-management-agent-for-microsoft-identity-manager/
#Seed Account
$twitterScreenName = 'mytwitteraccount'
# Output directory for the MA Import File
$downloadDirectory = 'C:\Program Files\Microsoft Forefront Identity Manager\2010\Synchronization Service\MaData\Twitter'
# Import XML Files Path
$importFileDirectory = 'C:\Users\darren\Dropbox\Kloud\Powershell\Twitter\data'
$tweetersinput = import-Clixml -Path $importFileDirectory+'\' + $twitterScreenName +'FollowersDetails.xml'
$tweetersinput.Count
# Get the ID's to compare against from followers input file
$baseIDs = @()
foreach ($id in $tweetersinput) {
$baseIDs += $id.id_str
}
# Get the Friends File
$tweetersinput2 = Import-Clixml -Path $importFileDirectory+'\' + $twitterScreenName +'FriendsDetails.xml'
$tweetersinput2.Count
# Ignote the duplicates and store the uniques
foreach ($twit in $tweetersinput2){
if($baseIDs | select-object | Where-Object {$_ -eq $twit.id_str} ){
#duplicate so ignore
}
else
{
$tweetersinput += $twit
write-host "Added" $twit.id_str
}
}
$tweetersinput.count
$tweetersinput | Export-Clixml -Path $downloadDirectory"\TwitterMAUsersInput.xml"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment