[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 111
  • Last Modified:

AD | Powershell

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
cmatchett
Asked:
cmatchett
2 Solutions
 
becraigCommented:
Something like this might work:
Get-ADUser -filter { (EmailAddress -eq $null) -and (homedirectory  -eq $null) }

Open in new window

0
 
Joshua GrantomSystems AdministratorCommented:
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
 
cmatchettAuthor Commented:
thanks guys!
0

Featured Post

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now