mbedford Posted June 7, 2013 Posted June 7, 2013 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 shot Any ideas? I don't understand how I can get the same answer on both queries.
AngryTechnician Posted June 7, 2013 Posted June 7, 2013 My PowerShell isn't great but I think you want this: Get-MsolUser | Where-Object {$_.isLicensed -eq $false} More info about why it's not bombing out by using the wrong type of 'false': Understanding Booleans in PowerShell - TechNet Articles - United States (English) - TechNet Wiki 1
EduTech Posted June 7, 2013 Posted June 7, 2013 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. 1
mbedford Posted June 7, 2013 Author Posted June 7, 2013 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 Thanks Mike
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now