none
Get-MsolUser Returns All Results as True RRS feed

  • Question

  • I'm attempting to find a list of all students who have a license for Yammer.

    Get-MsolUser -All -Title Student | Where-Object {$_.isLicensed -eq $true -and $_.Licenses.ServiceStatus[2].ProvisioningStatus -ne "Disabled"}

    This returns thousands of results with the value True for all. Yet, when I check the admin center most of the results do not have access to yammer. What do I need to modify or add in order to receive a list of users who actually have the license?

    Thank you!

    Wednesday, January 11, 2017 10:41 PM

All replies

  • Hi,

    Same command has no issues, so I suggest check the -Title parameter:

    Best regards,

    Andy


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Thursday, January 12, 2017 6:29 AM
    Moderator
  • Yes, quotation marks help! Still getting users who don't have access to Yammer showing up in this list when they should not be. The only users in this list should be students who do have a Yammer License. Yet, when I look up a student using the admin page they don't have the license.
    Thursday, January 12, 2017 5:39 PM
  • I've done a lot of research on this and most of the instructions I've followed have come from the following:

    Nevermind, not allowed to post links yet... search technet for:

    View account license and service details with Office 365 PowerShell

    Unfortunately, these instructions do not work.

    I think the problem lies in that the Licenses property is multi-valued. So, when asking for those users the value returns true because there is something there. For example, there are about 9 services (Flow, Sway, Forms, Yammer, ProPlus, Skype, etc...) Nearly all of our users have at least one of these services so a query will always return true. What I need to know is which users have specific services.

    Thursday, January 12, 2017 8:02 PM
  • Hi,

    >>What I need to know is which users have specific services

    Use this:

    (Get-MsolUser -UserPrincipalName <Account>).Licenses[<LicenseIndexNumber>].ServiceStatus

    https://technet.microsoft.com/en-us/library/dn771771.aspx?f=255&MSPPError=-2147217396

    Best regards,

    Andy


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Thursday, January 19, 2017 8:32 AM
    Moderator