Solved

AD | Powershell

Posted on 2014-11-04
3
90 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
3 Comments
 
LVL 29

Assisted Solution

by:becraig
becraig earned 250 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 250 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Microsoft Windows Server Update Service (WSUS) is free for everyone, but it lacks of some desirable features like send an e-mail to the administrator with the status of all computers on the WSUS server. This article is based on my PowerShell script …
In this previous article (https://oddytee.wordpress.com/2016/05/05/provision-new-office-365-user-and-mailbox-from-exchange-hybrid-via-powershell/), we made basic license assignments to users in O365. When I say basic, the method is the simplest way …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

777 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