Last active
November 17, 2018 20:32
-
-
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/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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