[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3664
  • Last Modified:

Get 365 Mailbox License Type (MSOnline not loaded error)

I am looking to get a list of user mailboxes along with license type info (E2 or E3).  We have Office 365, and I have been trying to use Azure Powershell to accomplish this.  Everything that I've found indicates that the cmdlets I need are located in the MSOnline module, but when I run Import-Module MSOnline, I get this error:
Import-Module : The specified module 'MSOnline' was not loaded because no valid module file was found in any module
directory.

Open in new window


I'm using win 7 64 bit.

How can I import this module? Thanks for reading.
0
thedeal56
Asked:
thedeal56
  • 6
  • 5
  • 2
2 Solutions
 
footechCommented:
Have you installed the module?  Use the appropriate link (32 or 64 bit) from the following:
http://technet.microsoft.com/en-us/library/jj151815.aspx#bkmk_installmodule
0
 
thedeal56Author Commented:
Thanks for the quick reply!  I just tried that, and I got this error:
error
I downloaded this:
http://www.microsoft.com/en-us/download/details.aspx?id=28177

but I still get the error after installing.
0
 
footechCommented:
Try the sign-on assistant that is linked to by the link I provided (it's just above the module installers).  Looks like it's a newer version by a couple years.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
thedeal56Author Commented:
Thanks! that got it installed, but I haven't had a chance to try to import the module again.  I will post as soon as I try it.
0
 
thedeal56Author Commented:
Ok, I had a chance to give it a shot.  Here's what I'm doing:

I open Azure Powershell,  I run this:
$LiveCred = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection
Import-PSSession $Session

Then I try to run:
import-module MSOnline

I then get this error:
error2
0
 
footechCommented:
When you installed the module, it should have created an item in the Start Menu called Windows Azure Active Directory.  Inside that should be a shortcut to launch a PowerShell console with the module loaded.  This should be the equivalent of running the Import-Module MSOnline command.

If it's still not coming up, you may want to run the command Get-Module -listavailable and see if "MSOnline" and "MSOnline Extended" are listed.
0
 
zulazenCommented:
I believe when I first set this up on my pc, there were 2 files I had to install: msoidcrl.msi, and administrationconfig-en.msi.  Try googling these files and make sure you install both of them.

After installing those, connect to MS online:

import-module msonline
connect-msolservice

Open in new window


Next, query your users and licenses
get-msoluser -all | select userprincipalname, licenses

Open in new window

0
 
zulazenCommented:
By the way, you can find those files I mentioned here: http://www.edwardsd.co.uk/work/2012/02/office-365/ .  Links to both 32 bit and 64 bit are available.
0
 
thedeal56Author Commented:
Thank you both so much.  I was able to get it working, and I used zulazen's example of:

get-msoluser -all | select userprincipalname, licenses

Open in new window


I am however getting this for my license type on every user:
System.Collections.Generic.List`1[Microsoft.Online.Administration.UserLicense]

Is there a way to show E2 or E3 in that field?
0
 
footechCommented:
You could try this.  Not sure exactly what it will show though.
get-msoluser -all | select userprincipalname, @{n="license";e={$_.licenses | % {$_.accountskuid}}}

Open in new window

0
 
thedeal56Author Commented:
Thank you.  I will give that a shot.   I actually ended up finding a decent existing script here:
http://gallery.technet.microsoft.com/scriptcenter/Export-a-Licence-b200ca2a

I used that, and I got what I needed.  

What's an appropriate distribution on points on this one?  Both of you helped me on different aspects of the issue.  Looking back, I probably should have made this into two questions.
0
 
footechCommented:
Yes, the Technet gallery is a great resource if you're ever looking for a script.

It's up to you whether you feel one contribution was more valuable/applicable than another.  I just evaluate each post on it's own as to how much information it provided that helped to arrive at a solution.
0
 
thedeal56Author Commented:
This really helped me out today, and it went a long way toward my understanding of PowerShell. Thank you both for your time.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 6
  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now