Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Microsoft Identity Manager PowerShell Management Agent for Twitter. Supporting blog post here https://blog.darrenjrobinson.com/a-twitter-management-agent-for-microsoft-identity-manager/
Install-Module -Name InvokeTwitterAPIs
Import-Module InvokeTwitterAPIs
#Seed Account
$twitterScreenName = 'mytwitteraccount'
# output directory for XML MA Import Files
$downloadDirectory = 'C:\Users\darren\Dropbox\Kloud\Powershell\Twitter\data'
$OAuths = @()
# My Twitter Account Key
# Not valid values obviously
$OAuthBA = @{'ApiKey' = 'IysRMMT6asdfasdVVNefP2DIwLiv'; 'ApiSecret' = 'CbgtzwIQf0JIIsdfkjsdf97ZFuM7C97BYbTgRPoqsBFafDIKXYq'; 'AccessToken' = '22887449-ZCp4ysUkw2lLB2iXrNVljsafdljsdfljdstxZIETb45B'; 'AccessTokenSecret' = 'ssrJtykkW2C43AK3esafdklkjfdsljlfds;jdnLKSLk9GR'}
$OAuths += $OAuthBA
# My Other Twitter Account app keys
# Not valid values obviously
$OAuthDC = @{'ApiKey' = '02HdTLtasdfsdfdsfkC3f7Y5t'; 'ApiSecret' = 'UziOItem1UlxnQNiesdfdsafsfdszwwr0hvbe62dWCmixs'; 'AccessToken' = '18929736-co7kF76TAsdfsdfdsdfdsf0IgU1NJKYFsM6sbxz0'; 'AccessTokenSecret' = 'HgwQNsCTyrD43IfhZoP79Osdfsadfsafdsfds7gRxzv'}
$OAuths += $OAuthDC
# Get Seed Account
$twitterSeed = Get-TwitterUser_Lookup -screen_name $twitterScreenName
$outfile = $downloadDirectory +'\' + $twitterScreenName +'Details.xml'
$twitterSeed | Export-Clixml -Path $outfile
# Get Seed Account and all Followers with details and export.
$twitterfollowerusers = Get-TwitterFollowers_IDs -screen_name $twitterScreenName -all | Get-TwitterUser_Lookup
$outfile = $downloadDirectory +'\' + $twitterScreenName +'FollowersDetails.xml'
$twitterfollowerusers | Export-Clixml -Path $outfile
# Get Seed Account and all Friends with details and export.
$twitterfriendsusers = Get-TwitterFriends_IDs -screen_name $twitterScreenName -all | Get-TwitterUser_Lookup
$outfile = $downloadDirectory +'\' + $twitterScreenName +'FriendsDetails.xml'
$twitterfriendsusers | Export-Clixml -Path $outfile
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.