Get mailbox users without ATP License

%3CLINGO-SUB%20id%3D%22lingo-sub-239349%22%20slang%3D%22en-US%22%3EGet%20mailbox%20users%20without%20ATP%20License%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-239349%22%20slang%3D%22en-US%22%3E%3CP%3EGet%20mailbox%20users%20without%20ATP%20License%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-239349%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExchange%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-241135%22%20slang%3D%22en-US%22%3ERe%3A%20Get%20mailbox%20users%20without%20ATP%20License%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-241135%22%20slang%3D%22en-US%22%3E%3CP%3EYou%20need%20to%20be%20looking%20at%20the%20AccountSkuId%20property%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EGet-MsolUser%26nbsp%3B-All%20%7C%20%3F%20%7B%24_.Licenses.AccountSkuId%20-ne%20%22tenant%3AATP_ENTERPRISE%22%7D%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3Eas%20this%20will%20return%20unlicensed%20users%20as%20well%2C%20you%20might%20prefer%20the%20below%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EGet-MsolUser%26nbsp%3B-All%20%7C%20%3F%20%7B%24_.Licenses.AccountSkuId%20-ne%20%22tenant%3AATP_ENTERPRISE%22%20-and%20%24_.IsLicensed%7D%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-240798%22%20slang%3D%22en-US%22%3ERe%3A%20Get%20mailbox%20users%20without%20ATP%20License%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-240798%22%20slang%3D%22en-US%22%3E%3CP%3EI%20hear%20you.%20I%20recently%20implemented%20some%20ATP%20policies%20on%20my%20tenant%20as%20well%20and%20was%20really%20confused%20as%20to%20how%20to%20assign%20the%20licenses.%20Eventually%20I%20created%20an%20Azure%20security%20group%20with%20dynamic%20membership.%20I%20said%20everyone%20that%20has%20an%20E3%20license%20should%20be%20added%20to%20that%20group.%20Then%20I%20went%20an%20assigned%20ATP%20licenses%20to%20that%20group.%20So%20in%20theory%20anyone%20that%20has%20an%20E3%20license%20will%20automatically%20get%20an%20ATP%20license.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20then%20later%20discovered%20that%20there%20is%20no%20need%20to%20assign%20ATP%20licenses%2C%20you%20just%20need%20to%20have%20them%20in%20your%20tenant%20so%20I%20ended%20up%20scrapping%20that%20Azure%20security%20group.%20(headbang)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EA%20good%20rule%20of%20thumb%20should%20be%20to%20have%20the%20number%20of%20ATP%20licenses%20match%20your%20E3%20licenses%20that%20way%20everything%20can%20match%20up.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-240711%22%20slang%3D%22en-US%22%3ERe%3A%20Get%20mailbox%20users%20without%20ATP%20License%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-240711%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Navishkar%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENow%20we%20ran%20out%20of%20ATP.%3C%2FP%3E%3CP%3EThat's%20why%20management%20need%20to%20know%20who%20doesn't%20have%20yet.%20to%20Procure%20additional%20more.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBest%20Regards%2C%3C%2FP%3E%3CP%3EMark%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-240710%22%20slang%3D%22en-US%22%3ERe%3A%20Get%20mailbox%20users%20without%20ATP%20License%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-240710%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EIn%20general%2C%20ATP%20licenses%20do%20not%20need%20to%20be%20assigned%20to%20users%2C%20so%20you%20just%20need%20to%20make%20sure%20you%20have%20enough%20licenses%20available%20in%20the%20tenant.%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F58%22%20target%3D%22_blank%22%3E%40Vasil%20Michev%3C%2FA%3E%26nbsp%3BThanks%20for%20clearing%20that%20up.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-240707%22%20slang%3D%22en-US%22%3ERe%3A%20Get%20mailbox%20users%20without%20ATP%20License%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-240707%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Vasil%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETried%20this%20attached%20but%20it%20returns%20users%20with%20ATP_ENTERPRISE%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screenshot_137.png%22%20style%3D%22width%3A%20989px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F44596i681331630E2EDB07%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Screenshot_137.png%22%20alt%3D%22Screenshot_137.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-240683%22%20slang%3D%22en-US%22%3ERe%3A%20Get%20mailbox%20users%20without%20ATP%20License%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-240683%22%20slang%3D%22en-US%22%3E%3CP%3ESimply%20use%20the%20%22not%22%20operator%20to%20get%20the%20%22opposite%22%20result%20set%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-239807%22%20slang%3D%22en-US%22%3ERe%3A%20Get%20mailbox%20users%20without%20ATP%20License%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-239807%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Vasil%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20will%20only%20return%20me%20users%20that%20has%20ATP%20license.%20Hope%20you%20could%20help%20me%20the%20other%20way%20arround.%20Users%20without%20ATP.%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EBest%20Regards%2C%3C%2FP%3E%3CP%3EMark%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-239754%22%20slang%3D%22en-US%22%3ERe%3A%20Get%20mailbox%20users%20without%20ATP%20License%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-239754%22%20slang%3D%22en-US%22%3E%3CP%3EAs%20I%20said%2C%20we're%20not%20mind%20readers%20here.%20My%20example%20assumes%20that%20you%20have%20ATP%20as%20part%20of%20E5%2C%20if%20you%20have%20the%20standalone%20license%20just%20query%20for%20the%20presence%20of%20the%20relevant%20SKU.%20If%20you%20don't%20know%20the%20SKUID%2C%20you%20can%20get%20it%20via%20Get-MsolAccountSku.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-239378%22%20slang%3D%22en-US%22%3ERe%3A%20Get%20mailbox%20users%20without%20ATP%20License%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-239378%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Vasil%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegret%20for%20the%20body%20of%20this.%3C%2FP%3E%3CP%3EOur%20company%20has%20stand%20alone%20ATP.%20Tried%20your%20script%20but%20it%20doesn't%20work%20check%20because%20the%20provisioning%20of%20her%20atp%20is%20ongoing.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ei%20have%20user%20showed%20up%20and%20she%20has%20atp%20assigned%20to%20her.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screenshot_134.png%22%20style%3D%22width%3A%20503px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F44407iF4CEE1198E58E009%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Screenshot_134.png%22%20alt%3D%22Screenshot_134.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBest%20Regards%2C%3C%2FP%3E%3CP%3EMark%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-239369%22%20slang%3D%22en-US%22%3ERe%3A%20Get%20mailbox%20users%20without%20ATP%20License%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-239369%22%20slang%3D%22en-US%22%3E%3CP%3EThis%20isn't%20google%2C%20and%20we%20are%20not%20mind%20readers%2C%20so%20can%20you%20maybe%20share%20some%20more%20details%20on%20what%20you%20are%20trying%20to%20achieve%3F%20And%20are%20you%20talking%20about%20the%20standalone%20ATP%20SKU%2C%20or%20ATP%20as%20part%20from%20E5%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20general%2C%20ATP%20licenses%20do%20not%20need%20to%20be%20assigned%20to%20users%2C%20so%20you%20just%20need%20to%20make%20sure%20you%20have%20enough%20licenses%20available%20in%20the%20tenant.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20can%20get%20a%20list%20of%20all%20users%20with%20or%20without%20a%20specific%20license%20from%20the%20O365%20admin%20portal%20-%26gt%3B%20Users%20-%26gt%3B%20click%20the%20View%20dropdown%20-%26gt%3B%20custom%20view.%20It%20might%20be%20easier%20to%20just%20use%20PowerShell%20though%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EGet-MsolUser%20-All%26nbsp%3B%20%7C%20%3F%20%7B%24_.Licenses.ServiceStatus%20%7C%20%3F%20%7B%24_.ServicePlan.ServiceName%20-eq%20%22ATP_ENTERPRISE%22%20-and%20%24_.ProvisioningStatus%20-ne%20%22Success%22%7D%7D%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Contributor

Get mailbox users without ATP License

10 Replies
Highlighted

This isn't google, and we are not mind readers, so can you maybe share some more details on what you are trying to achieve? And are you talking about the standalone ATP SKU, or ATP as part from E5?

 

In general, ATP licenses do not need to be assigned to users, so you just need to make sure you have enough licenses available in the tenant.

 

You can get a list of all users with or without a specific license from the O365 admin portal -> Users -> click the View dropdown -> custom view. It might be easier to just use PowerShell though:

 

Get-MsolUser -All  | ? {$_.Licenses.ServiceStatus | ? {$_.ServicePlan.ServiceName -eq "ATP_ENTERPRISE" -and $_.ProvisioningStatus -ne "Success"}}

 

Highlighted

Hi Vasil,

 

Regret for the body of this.

Our company has stand alone ATP. Tried your script but it doesn't work check because the provisioning of her atp is ongoing.

 

i have user showed up and she has atp assigned to her.

Screenshot_134.png

 

Best Regards,

Mark

Highlighted

As I said, we're not mind readers here. My example assumes that you have ATP as part of E5, if you have the standalone license just query for the presence of the relevant SKU. If you don't know the SKUID, you can get it via Get-MsolAccountSku.

Highlighted

Hi Vasil,

 

It will only return me users that has ATP license. Hope you could help me the other way arround. Users without ATP.


Best Regards,

Mark

Highlighted

Simply use the "not" operator to get the "opposite" result set?

Highlighted

Hi Vasil,

 

Tried this attached but it returns users with ATP_ENTERPRISEScreenshot_137.png

Highlighted

In general, ATP licenses do not need to be assigned to users, so you just need to make sure you have enough licenses available in the tenant. @Vasil Michev Thanks for clearing that up.

Highlighted

Hi Navishkar,

 

Now we ran out of ATP.

That's why management need to know who doesn't have yet. to Procure additional more.

 

Best Regards,

Mark

Highlighted

I hear you. I recently implemented some ATP policies on my tenant as well and was really confused as to how to assign the licenses. Eventually I created an Azure security group with dynamic membership. I said everyone that has an E3 license should be added to that group. Then I went an assigned ATP licenses to that group. So in theory anyone that has an E3 license will automatically get an ATP license.

 

I then later discovered that there is no need to assign ATP licenses, you just need to have them in your tenant so I ended up scrapping that Azure security group. (headbang)

 

A good rule of thumb should be to have the number of ATP licenses match your E3 licenses that way everything can match up.

Highlighted

You need to be looking at the AccountSkuId property:

 

Get-MsolUser -All | ? {$_.Licenses.AccountSkuId -ne "tenant:ATP_ENTERPRISE"}

 

as this will return unlicensed users as well, you might prefer the below:

 

Get-MsolUser -All | ? {$_.Licenses.AccountSkuId -ne "tenant:ATP_ENTERPRISE" -and $_.IsLicensed}