Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.




516 posts

Ultimate Geek


# 239429 17-Jul-2018 13:15

Hi Guys,

I am trying PowerShell to see what users have no license for 0365 in the customers tenants.
This is easy enough as I can use:

Get-MsolUser - All

However this gives me also the list of shared mailbox's which doesn't require a license.
I had a look and try to find a way to filter out shared mailbox but can't see a way.

Has anyone done this before or has any tips on how I can do this?

Thanks

Create new topic
781 posts

Ultimate Geek

Trusted

  # 2057720 17-Jul-2018 13:54
Send private message

Can you work with something like this

 

 

 

Get-Mailbox -ResultSize Unlimited -RecipientTypeDetails SharedMailbox | Get-MsolUser | Where-Object { $_.isLicensed -eq "TRUE" }

 

 

 

SharedMail box, change to User 

 

isLicensed -eq FALSE





The little things make the biggest difference.




516 posts

Ultimate Geek


  # 2058207 18-Jul-2018 10:29

Thanks yeah I did try that I found the below website which sort of does what I want as well.

https://www.mowasay.com/2016/03/office365-get-a-list-of-shared-mailboxes-that-are-accidentally-licensed/

Sadly i keep getting a error:

Get-MsolUser : The term 'Get-MsolUser' is not recognized as the name of a cmdlet, function, script file or operable program.

 
 
 
 


108 posts

Master Geek

Microsoft NZ

  # 2058321 18-Jul-2018 12:58
Send private message

Oriphix: Thanks yeah I did try that I found the below website which sort of does what I want as well.

https://www.mowasay.com/2016/03/office365-get-a-list-of-shared-mailboxes-that-are-accidentally-licensed/

Sadly i keep getting a error:

Get-MsolUser : The term 'Get-MsolUser' is not recognized as the name of a cmdlet, function, script file or operable program.

 

 

 

Have you used Connect-Msolservice beforehand?

 

Different connection string than what you'd use to connect to Exchange Online. 


376 posts

Ultimate Geek


  # 2058336 18-Jul-2018 13:43
Send private message

Oriphix: Thanks yeah I did try that I found the below website which sort of does what I want as well.

https://www.mowasay.com/2016/03/office365-get-a-list-of-shared-mailboxes-that-are-accidentally-licensed/

Sadly i keep getting a error:

Get-MsolUser : The term 'Get-MsolUser' is not recognized as the name of a cmdlet, function, script file or operable program.

 

Edit:Should have read the script first.

 

Install Microsoft Exchange Online Powershell Module from the Exchange admin portal, its under Hybrid. (This works with MFA if you have it enabled).

 

Run the link it creates on your desktop. "Microsoft Exchange Online Powershell Module"

 

Connect-EXOPSSession

 

Connect-MsolService

 

Get-Mailbox -ResultSize Unlimited -RecipientTypeDetails SharedMailbox | Get-MsolUser | Where-Object
{ $_.isLicensed -eq "TRUE" }      - Copied from website, change to fit your needs.




516 posts

Ultimate Geek


  # 2058348 18-Jul-2018 14:19

Thanks for the replies guys still doesn't work.

@plas : I tried to install that exchange module it doesn't install just errors out. This particular account I am not using MFA.
@Jogre : Yes I am see the image below.

After I enter the credentials to login this error comes up straight after.


108 posts

Master Geek

Microsoft NZ

  # 2058350 18-Jul-2018 14:23
Send private message

Oriphix: Thanks for the replies guys still doesn't work.

@plas : I tried to install that exchange module it doesn't install just errors out. This particular account I am not using MFA.
@Jogre : Yes I am see the image below.

After I enter the credentials to login this error comes up straight after.

 

Get-Mailbox and Get-Msoluser are different cmdlets. MsolUser will only return information from Office 365 Admin Center, whereas Get-Mailbox will return from Exchange Online Admin Center or On-Prem Exchange.

 

So if you use Connect-MsolService you would only be able to run Get-MsolUser unless you had also auth'd against EAC.


235 posts

Master Geek


  # 2058358 18-Jul-2018 14:54
Send private message

does this command get a hit;

 

Get-Module -ListAvailable | Where-Object {$_ -match "Get-MsolUser"}

 

If you do not get a hit try;

 

Find-Module -Name Get-MsolUser

 

Unusually for Microsoft product it gives a helpful error message.





Obsequious hypocrite

Create new topic



Twitter and LinkedIn »



Follow us to receive Twitter updates when new discussions are posted in our forums:



Follow us to receive Twitter updates when news items and blogs are posted in our frontpage:



Follow us to receive Twitter updates when tech item prices are listed in our price comparison site:





News »

Arlo unveils its first video doorbell
Posted 21-Oct-2019 08:27


New Zealand students shortlisted for James Dyson Award
Posted 21-Oct-2019 08:18


Norton LifeLock Launches Norton 360
Posted 21-Oct-2019 08:11


Microsoft New Zealand Partner Awards results
Posted 18-Oct-2019 10:18


Logitech introduces new Made for Google keyboard and mouse devices
Posted 16-Oct-2019 13:36


MATTR launches to accelerate decentralised identity
Posted 16-Oct-2019 10:28


Vodafone X-Squad powers up for customers
Posted 16-Oct-2019 08:15


D Link ANZ launches EXO Smart Mesh Wi Fi Routers with McAfee protection
Posted 15-Oct-2019 11:31


Major Japanese retailer partners with smart New Zealand technology IMAGR
Posted 14-Oct-2019 10:29


Ola pioneers one-time passcode feature to fight rideshare fraud
Posted 14-Oct-2019 10:24


Spark Sport new home of NZC matches from 2020
Posted 10-Oct-2019 09:59


Meet Nola, Noel Leeming's new digital employee
Posted 4-Oct-2019 08:07


Registrations for Sprout Accelerator open for 2020 season
Posted 4-Oct-2019 08:02


Teletrac Navman welcomes AI tech leader Jens Meggers as new President
Posted 4-Oct-2019 07:41


Vodafone makes voice of 4G (VoLTE) official
Posted 4-Oct-2019 07:36



Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.


Support Geekzone »

Our community of supporters help make Geekzone possible. Click the button below to join them.

Support Geezone on PressPatron



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.

Alternatively, you can receive a daily email with Geekzone updates.