• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 298
  • Last Modified:

Find all Disabled users in the Ads who do not have a Mailbox

Hi,

I want a script to Find all Disabled users in the Ads who do not have a Mailbox.

Is there a way to find this.

Regards
Sharath
0
bsharath
Asked:
bsharath
1 Solution
 
Farhan KaziSystems EngineerCommented:
Try this:

Click Start -> Run -> Cmd.exe

DSQuery * -Filter "(&(sAMAccountType=805306368)(UserAccountControl:1.2.840.113556.1.4.803:=2)(!homeMDB=*))" -Attr samAccountName

OR (To search within a specific OU)

DSQuery * "OU=ACCOUNTS,DC=TRAINING,DC=COM" -Filter "(&(sAMAccountType=805306368)(UserAccountControl:1.2.840.113556.1.4.803:=2)(!homeMDB=*))" -Attr samAccountName

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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