Skip to content

Instantly share code, notes, and snippets.

Last active November 29, 2018 23:00
What would you like to do?
Microsoft Identity Manager Metaverse PowerShell Reporting. Associated blog post is located here
# 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
$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;
# 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