Solved

Office 365--Powershell Script needed to find all users with a certain UPN

Posted on 2014-11-07
2
5,983 Views
Last Modified: 2014-11-07
Powershell Script needed to find all users with a certain UPN ending in @domain.org in my 365 Tenant. What query or filter can i use with Get-MSolUser -All ?

This one doens't work:

  Get-MSoluser -All |? {$_.IsLicensed -match 'False' -and $_.UserPrincipalName -match '*@domain.org'}
0
Comment
Question by:K Anthony O365
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 13

Accepted Solution

by:
lciprianionut earned 500 total points
ID: 40428482
Did you tried Get-MSoluser -All -DomainName "domain.org" |? {-not $_.IsLicensed}
Also this should work Get-MSoluser -All |? {-not $_.IsLicensed -and $_.UserPrincipalName -like "*@domain.org"}
0
 

Author Closing Comment

by:K Anthony O365
ID: 40428638
Excellent! Worked as expected.
0

Featured Post

What, When and Where - Security Threats from Q1

Join Corey Nachreiner, CTO, and Marc Laliberte, Information Security Threat Analyst, on July 26th as they explore their key findings from the first quarter of 2017.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In-place Upgrading Dirsync to Azure AD Connect
Microsoft is moving in-place eDiscovery & hold from ECP to EOP console under Content Search in Search and Investigation Options.  In this post, I will be showing you how to export emails to a PST file using the Content Search Options.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question