Jump to content

Recommended Posts

Posted

Help!

 

I am running the following command when connected to MSOnline

 

Get-MsolUser | Where-Object {$_.isLicensed -eq "FALSE"}

 

This returns 230 users (all of my users)

 

If I run the same command with FALSE (i.e not licensed), I get....... 230 users (all of my users)

 

See screen shotUntitled.png

 

Any ideas? I don't understand how I can get the same answer on both queries.

Posted

Hi,

 

Yes the following command you need is as follows:

 

Get-MsolUser -all | Where-Object {$_.isLicensed -eq $false} | Export-Csv C:\UnlicensedUsers.csv

 

-all = means it will completed the entire request

 

$false = displays the unlicensed users

 

Export-Csv = Puts it in a file for you, save having it listed in the powershell console.

 

That article above is handy to read also that AngryTechnician Linked you too.

 

James.

  • Thanks 1
Posted

Thanks both, the moment i read the solution I understood completely. I have been working with PowerShell for a few months now so you would think I would have realised that. Strange thing is, i took that command text straight from a technet post :confused:

 

Thanks

Mike

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...