Skip to content

Instantly share code, notes, and snippets.

@darrenjrobinson
Last active November 29, 2018 23:00
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/7786527fd215805f81964c22141043f4 to your computer and use it in GitHub Desktop.
Save darrenjrobinson/7786527fd215805f81964c22141043f4 to your computer and use it in GitHub Desktop.
Microsoft Identity Manager Metaverse PowerShell Reporting. Associated blog post is located here https://blog.darrenjrobinson.com/simple-reporting-from-the-fim-mim-metaverse-to-powerbi-using-the-lithnet-fim-mim-sync-service-powershell-module/
# Import the MVPSModule
Import-Module LithnetMIISAutomation
# Output for the report data
$downloadDirectory = 'C:\Program Files\Microsoft Forefront Identity Manager\2010\Synchronization Service\MaData\Twitter'
# Metaverse Data Query
$queryfilter = @();
$queryfilter += New-MVQuery -Attribute location -Operator Contains 'Sydney'
$queryfilter += New-MVQuery -Attribute employeeStatus -Operator isPresent
# Execute query and get results
$results = Get-MVObject -Queries $queryfilter | Select-Object -Property Attributes | select -expand *
# Get a subset of the attribures
[int]$i=0
$userdetails = $results | foreach {
New-Object PSObject -prop @{
IDAnchor = $results[$i].employeeid.values.valuestring;
TwitterName = $results[$i].uid.Values.valuestring;
Location = $results[$i].location.Values.valuestring;
Status = $results[$i].employeeStatus.Values.valuestring;
Description = $results[$i].description.Values.valuestring;
NumFriends = $results[$i].FriendsCount.values.valueinteger;
NumFollowers = $results[$i].FollowersCount.values.valueinteger;
}
$i++
}
# Output to CSV
$userdetails | Export-Csv -NoTypeInformation -Path $downloadDirectory"\TweetersOut.csv"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment