The MSV UI (Settings, then User Settings) only shows the User’s email address, first name, last name, and group. But MSV actually keeps up with more than that. MSV maintains details such as last log in, when the user was created, and what timezone the user is located in.
This information is accessible by calling https://<<director_hostname_or_Ip>>/settings/users.json . The result is a JSON formatted file that contains all of this information about every active (non-disabled) user.
This can be scripted to go into a CSV file (which can be opened in a spreadsheet software product) which is easier to read. An example (with Gemini’s assistance creating) is as follows:
# Define variables
$uri = "https://<<director hostname or ip>>/settings/users.json"
$bearerToken = "<<api key>>" # Replace with your actual token to call the MSV API
$outputPath = "<<path to file>>.csv" # Replace with your desired output path
# Construct headers with bearer token
$headers = @{
"Authorization" = "Bearer $bearerToken"
"Accept" = "application/json"
}
# Make the API request and get JSON data
try {
$jsonData = Invoke-RestMethod -Uri $uri -Method GET -Headers $headers
}
catch {
Write-Host "Error making API request: $($_.Exception.Message)"
exit
}
# Export the JSON data (as PowerShell objects) to CSV
if ($jsonData) {
$jsonData | Export-Csv -Path $outputPath -NoTypeInformation
Write-Host "Data successfully exported to $outputPath"
} else {
Write-Host "No data received from the API."
}This can also be done by doing similar work in Python. (The script above is just for demonstrative purposes.)
So for those organizations that want to ensure inactive users are removed, it can easily be discerned by using the MSV API.