Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Microsoft Identity Manager PowerShell Management Agent for Twitter. Supporting blog post here
#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'
# 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'
# Ignote the duplicates and store the uniques
foreach ($twit in $tweetersinput2){
if($baseIDs | select-object | Where-Object {$_ -eq $twit.id_str} ){
#duplicate so ignore
$tweetersinput += $twit
write-host "Added" $twit.id_str
$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
You can’t perform that action at this time.