?
Solved

AD | Powershell

Posted on 2014-11-04
3
Medium Priority
?
104 Views
Last Modified: 2014-11-10
Could i please seek assistance for a script to..

export all the usernames of users in active directory

where the homedirectory path and email are both blank
0
Comment
Question by:cmatchett
[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
3 Comments
 
LVL 29

Assisted Solution

by:becraig
becraig earned 1000 total points
ID: 40422522
Something like this might work:
Get-ADUser -filter { (EmailAddress -eq $null) -and (homedirectory  -eq $null) }

Open in new window

0
 
LVL 16

Accepted Solution

by:
Joshua Grantom earned 1000 total points
ID: 40424915
Since those properties are strings you may also try this if $null doesnt work.

Get-ADUser -Filter {( EmailAddress -notlike "*") -and (homedirectory -notlike "*")} | Select Name,SamAccountName

Open in new window

0
 

Author Closing Comment

by:cmatchett
ID: 40432685
thanks guys!
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

The Nano Server Image Builder helps you create a custom Nano Server image and bootable USB media with the aid of a graphical interface. Based on the inputs you provide, it generates images for deployment and creates reusable PowerShell scripts that …
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

762 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