SOLVED

export licenses

Brass Contributor

 

Hi experts

 

1 Is it possible to export the users list for which i have assigned the licenses in office365 from shell.
i want to export for which user which license i have assigned.

2. I am using exchange hybrid environment, i was having a user in exchange on premises, i have migrated this user to cloud and have assigned office365 license. Now i have disabled this account in active directory. will Office365 license be revoked automatically or is there any time frame for this to be revoked or do i need to revoke the license manually

2 Replies
best response confirmed by Rising Flight (Brass Contributor)
Solution
Try this
Get-MSOLUser | % { $user=$_; $_.Licenses | Select {$user.displayname},AccountSKuid } | Export-CSV "sample.csv" -NoTypeInformation

Sorry! Here is number 2:
Disabling a user I ad will set the status to blocked in office 365! The license will remain set on the user

Adam
1 best response

Accepted Solutions
best response confirmed by Rising Flight (Brass Contributor)
Solution
Try this
Get-MSOLUser | % { $user=$_; $_.Licenses | Select {$user.displayname},AccountSKuid } | Export-CSV "sample.csv" -NoTypeInformation

View solution in original post