AD Object Type

This topic contains 4 replies, has 2 voices, and was last updated by  Aaron 1 year ago.

  • Author
    Posts
  • #57731

    Aaron
    Participant

    How can I find out if an object is a user or group?

    Say I do a get-acl and i see...

    domain\awellis
    domain\IT GROUP

    Is there a command to query AD to see that the first one's type is user and the 2nd one's is a group?

  • #57742

    Olaf Soyk
    Participant

    Get-ADObject outputs among other stuff the ObjectClass

  • #57745

    Aaron
    Participant

    Ahhhhh that was too easy! Thanks for that...

    Works just like I needed it to

    ((Get-ADObject -filter *) | ?{$_.name -like "admibistrator"}).objectclass

    • #57746

      Olaf Soyk
      Participant

      If you move your filter to the cmdlet it might be faster if you're lucky

      (Get-ADObject -filter {Name -like "admibistrator"}).objectclass
  • #57752

    Aaron
    Participant

    Even faster..thanks again sir!

You must be logged in to reply to this topic.