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.


Oriphix

523 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
Shindig
1585 posts

Uber 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.




Oriphix

523 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.

Jogre
182 posts

Master Geek


  #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. 




plas
453 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.


Oriphix

523 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.


Jogre
182 posts

Master Geek


  #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.


ObidiahSlope
260 posts

Ultimate 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





News and reviews »

Air New Zealand Starts AI adoption with OpenAI
Posted 24-Jul-2025 16:00


eero Pro 7 Review
Posted 23-Jul-2025 12:07


BeeStation Plus Review
Posted 21-Jul-2025 14:21


eero Unveils New Wi-Fi 7 Products in New Zealand
Posted 21-Jul-2025 00:01


WiZ Introduces HDMI Sync Box and other Light Devices
Posted 20-Jul-2025 17:32


RedShield Enhances DDoS and Bot Attack Protection
Posted 20-Jul-2025 17:26


Seagate Ships 30TB Drives
Posted 17-Jul-2025 11:24


Oclean AirPump A10 Water Flosser Review
Posted 13-Jul-2025 11:05


Samsung Galaxy Z Fold7: Raising the Bar for Smartphones
Posted 10-Jul-2025 02:01


Samsung Galaxy Z Flip7 Brings New Edge-To-Edge FlexWindow
Posted 10-Jul-2025 02:01


Epson Launches New AM-C550Z WorkForce Enterprise printer
Posted 9-Jul-2025 18:22


Samsung Releases Smart Monitor M9
Posted 9-Jul-2025 17:46


Nearly Half of Older Kiwis Still Write their Passwords on Paper
Posted 9-Jul-2025 08:42


D-Link 4G+ Cat6 Wi-Fi 6 DWR-933M Mobile Hotspot Review
Posted 1-Jul-2025 11:34


Oppo A5 Series Launches With New Levels of Durability
Posted 30-Jun-2025 10:15









Geekzone Live »

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



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.