Finding disabled users

Welcome Forums General PowerShell Q&A Finding disabled users

This topic contains 0 replies, has 1 voice, and was last updated by  Forums Archives 7 years, 2 months ago.

  • Author
  • #6173

    Points: 0
    Rank: Member

    by Villdyret at 2012-09-03 13:40:14

    Hi. I would like a nice little command that can give me all the users in a spesific OU, with Fullname and Alias.
    I would also like to find all the disabled users, and expired users within the same OU. Can anyone help?

    by mjolinor at 2012-09-03 14:19:02

    Using the AD module comdlets:
    For the first:

    get-ADUser -SearchRoot -properties mailNickname |
    select @{l='Fullname';e={$_.Name}},@{l='Alias';e={$_.mailNickname}}

    For the second:

    Search-ADAccount -SearchBase -AccountDisabled
    Search-ADAccount -SearchBase

The topic ‘Finding disabled users’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort