Windows Perl Scripting Forums » Scripts

Getting user attributes in AD

(1 post)
  • Started 8 years ago by StarkRavingCalm

No tags yet.


  1. StarkRavingCalm
    Member

    So I have a simple script that does a user dump in AD.

    How can I modify it to get specific attributes for each user? Like Organaztional Unit or Managed By?

     

    script follows:

     

    use Win32::OLE 'in';

    $ADsPath = "WinNT://mydomain/a domaincontroller";

    $c = Win32::OLE->GetObject($ADsPath) or warn "Unable to get $ADsPath\n";
    foreach $adsobj (in$c) {
        print $adsobj->{Name},"\n" if ($adsobj->{Class} eq "User")
    }
     

    Posted 8 years ago #

RSS feed for this topic

Reply

You must log in to post.