SOLVED

export licenses

%3CLINGO-SUB%20id%3D%22lingo-sub-275823%22%20slang%3D%22en-US%22%3Eexport%20licenses%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-275823%22%20slang%3D%22en-US%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHi%20experts%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E1%20Is%20it%20possible%20to%20export%20the%20users%20list%20for%20which%20i%20have%20assigned%20the%20licenses%20in%20office365%20from%20shell.%3CBR%20%2F%3Ei%20want%20to%20export%20for%20which%20user%20which%20license%20i%20have%20assigned.%3C%2FP%3E%3CP%3E2.%20I%20am%20using%20exchange%20hybrid%20environment%2C%20i%20was%20having%20a%20user%20in%20exchange%20on%20premises%2C%20i%20have%20migrated%20this%20user%20to%20cloud%20and%20have%20assigned%20office365%20license.%20Now%20i%20have%20disabled%20this%20account%20in%20active%20directory.%20will%20Office365%20license%20be%20revoked%20automatically%20or%20is%20there%20any%20time%20frame%20for%20this%20to%20be%20revoked%20or%20do%20i%20need%20to%20revoke%20the%20license%20manually%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-275823%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EProPlus%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-275835%22%20slang%3D%22en-US%22%3ERe%3A%20export%20licenses%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-275835%22%20slang%3D%22en-US%22%3ESorry!%20Here%20is%20number%202%3A%3CBR%20%2F%3EDisabling%20a%20user%20I%20ad%20will%20set%20the%20status%20to%20blocked%20in%20office%20365!%20The%20license%20will%20remain%20set%20on%20the%20user%3CBR%20%2F%3E%3CBR%20%2F%3EAdam%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-275828%22%20slang%3D%22en-US%22%3ERe%3A%20export%20licenses%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-275828%22%20slang%3D%22en-US%22%3ETry%20this%3CBR%20%2F%3EGet-MSOLUser%20%7C%20%25%20%7B%20%24user%3D%24_%3B%20%24_.Licenses%20%7C%20Select%20%7B%24user.displayname%7D%2CAccountSKuid%20%7D%20%7C%20Export-CSV%20%22sample.csv%22%20-NoTypeInformation%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E
Highlighted
Frequent 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
Highlighted
Best Response confirmed by Rising Flight (Frequent Contributor)
Solution
Try this
Get-MSOLUser | % { $user=$_; $_.Licenses | Select {$user.displayname},AccountSKuid } | Export-CSV "sample.csv" -NoTypeInformation

Highlighted
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