AD Object Type

This topic contains 4 replies, has 2 voices, and was last updated by Profile photo of Aaron Aaron 2 weeks, 6 days ago.

  • Author
    Posts
  • #57731
    Profile photo of Aaron
    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
    Profile photo of Olaf Soyk
    Olaf Soyk
    Participant

    Get-ADObject outputs among other stuff the ObjectClass

  • #57745
    Profile photo of Aaron
    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
      Profile photo of Olaf Soyk
      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
    Profile photo of Aaron
    Aaron
    Participant

    Even faster..thanks again sir!

You must be logged in to reply to this topic.