List of department's users do not have a license for Office365
Hi folks,

My organization has a subscription to Office 365. Cloud sync with the local AD

I am establish the remote session with the cloud. I want to find all users in who do not have a license for Office 365.
For first, I wrote the following pipe:

Get-MsolUser -MaxResults 500 | Where-Object { $_.isLicensed -eq "false"  }  | Select-Object UserPrincipalName, DisplayName, Department | sort department | Export-Csv c:\powershell\LicensedUser s.csv  
and receive valid csv table.
then I want to get a list of users for a particular department, and for this to run the following command

Get-MsolUser -MaxResults 500 | Where-Object { $_.isLicensed -eq "false" -and $_.department -eq "marketing"  }  | Select-Object UserPrincipalName, DisplayName,  Department | Export-Csv c:\powershell\LicensedUsers.csv

Pipe  is running without an error messages, but the csv table is empty

What I did wrong?

Please, help
August 4th, 2015 9:38am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics