Last active
November 17, 2018 20:33
-
-
Save darrenjrobinson/5afff9392420e83ea529e66abea3f62a 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
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