Get Details for Users in a File: Difference between revisions
Appearance
Created page with "Category: Powershell Script Examples bla" |
No edit summary |
||
| Line 1: | Line 1: | ||
[[Category: Powershell Script Examples]] | [[Category: Powershell Script Examples]] | ||
==Prereqs:== | |||
*TeamsAdmin Rights | |||
*Connect-MicrosoftTeams has to be done already!!! | |||
==Function:== | |||
* Read user from .\users.txt (one user e-mail per line) | |||
* get fields to be verified | |||
* write results to .\UserDetails.csv delimited with ";" | |||
==Script== | |||
$UserNamesList = get-content -path ".\users.txt" | |||
$exportPath = ".\UserDetails.csv" | |||
foreach ($name in $UserNamesList){ | |||
get-csonlineuser -identity $name | select DisplayName,WindowsEmailAddress,EnterpriseVoiceEnabled,OnPremLineUri,OnlineVoiceRoutingPolicy,TenantDialPlan | Export-CSV $ExportPath -Append -Delimiter ";" -NoTypeInformation | |||
} | |||
Latest revision as of 13:50, 17 November 2021
Prereqs:
- TeamsAdmin Rights
- Connect-MicrosoftTeams has to be done already!!!
Function:
- Read user from .\users.txt (one user e-mail per line)
- get fields to be verified
- write results to .\UserDetails.csv delimited with ";"
Script
$UserNamesList = get-content -path ".\users.txt"
$exportPath = ".\UserDetails.csv"
foreach ($name in $UserNamesList){
get-csonlineuser -identity $name | select DisplayName,WindowsEmailAddress,EnterpriseVoiceEnabled,OnPremLineUri,OnlineVoiceRoutingPolicy,TenantDialPlan | Export-CSV $ExportPath -Append -Delimiter ";" -NoTypeInformation
}