Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cls
- $users = @()
- #$users = import-csv "<path>" | select -expandproperty <property>
- $a = @()
- foreach($user in $users)
- {
- Get-MsolUser -userprincipalname $user | %{
- $upn = $_.userprincipalname
- $_.licenses | %{
- $licence = $_.accountsku.skupartnumber
- $_.servicestatus | %{
- $a += new-object psobject -Property @{
- UserPrincipalName = $upn
- Status = $_.ProvisioningStatus
- Licence = $licence
- Service = $_.ServicePlan.servicename
- }
- }
- }
- }
- }
- $a | select userprincipalname, licence, service, status
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement