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.
thedeal56Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.