I know you wanted a Web Version, but here is something you might find Educational. I tried creating a Web Version, but I haven't had time to do it. But atleast I can give you something to look at. It only unlocks people that are locked out.
but it is always nice to see how someone else has done it.
use Win32::OLE; use Win32::OLE 'in'; use Win32::OLE::Enum; use Win32::NetAdmin; @empty = (); ($sec,$min,$hour,$day,$mon,$yr,$wday,$yday,$dntcare)=localtime(time); + $yr-=100; $yr="$yr"; $yr = (length($yr)<2) ? "0$yr" : $yr; $mon = (++$mon < 10) ? "0$mon" : "$mon"; $day = ($day < 10) ? "0$day" : "$day"; $date = "unlock$day-$mon-$yr.txt"; open (UNLOCK , ">>$date") || die "Can\\'t Create file"; while ( $choice != 7 ) { system(cls); print "=============================================================== +===========\n"; print "This Program Will Unlock Users on the Network. Enter the \n"; print "Number for the location and press the Enter Key\n"; print "Created by: Steve Sherman\n"; print "=============================================================== +===========\n"; print "\n"; print "\n"; print "1) Main\n"; print "2) Regional\n"; print "3) Cuba\n"; print "4) Union\n"; print "5) Motor\n"; print "6) Labadie\n"; print "7) Exit\n\n"; $choice = <stdin>; chomp($choice); sub Localuser { if (Win32::NetAdmin::LoggedOnUsers($server,\%userRef)) { print UNLOCK "User: " . $userRef{1} . " Unlocked the Following user\n" +; @local = split(/;/,$userRef{1}); my $accesslocal = Win32::OLE->GetObject("LDAP://$local[0]"); foreach $group (in $accesslocal->{memberof}) { push(@groups, $group); print "$group\n"; } } } sub Lookup { my $adsuser = Win32::OLE->GetObject("LDAP://bos-ad01/ou=$location,dc=a +sdf,dc=com") || die ("Can't find user: ".Win32::OLE->LastError()."\n"); $strDomain = "adsg"; $num = 1; foreach $strUsername (in $adsuser){ my $objUser = Win32::OLE->GetObject("WinNT://$strDomai +n/$strUsername-> {sAMAccountName}"); if ($objUser->{IsAccountLocked} == 1) { #$objUser->{IsAccountLocked} = 0; #$objUser->SetInfo; print "$num) $strUsername->{sAMAccountName}\n"; push(@users, $strUsername->{sAMAccountName}); push(@DnUsers, $strUsername->{distinguishedName} +); $num++; } }#end foreach if (@users == @empty) { print "No Users to Unlock \n\n"; } } sub unlock { if (@users == @empty) { next; } if ($choice == 0) { next; } $choice = $choice - 1; my $objUser = Win32::OLE->GetObject("LDAP://bos-ad01/$DnUsers[$cho +ice]"); print "$!\n"; $objUser->{IsAccountLocked} = 0; $objUser->SetInfo(); Localuser(); print UNLOCK "$users[$choice]\n"; print UNLOCK "$day-$mon-$yr\n\n"; @users = (); @DnUsers = (); } if ($choice == 1) { $location = "main"; system(cls); print "======================================================= +===================\n"; print "Select The Number that is associated with the user you +wish to unlock\n"; print "then press the Enter key.\n"; print "************************ WARNING WARNING WARNING ****** +*******************\n"; print "Please Only Unlock The user(s) that have requested to b +e unlocked\n"; print "======================================================= +===================\n"; Lookup(); print "0 ) Exit\n\n"; $choice = <stdin>; unlock(); } if ($choice == 2) { $location = "Regional"; system(cls); print "Select The User you wish to Unlock\n"; print "To Exit Press 0\n"; print "=====================================\n\n\n"; Lookup(); print "0 ) Exit\n\n"; $choice = <stdin>; unlock(); } if ($choice == 3) { $location = "Cuba"; system(cls); print "Select The User you wish to Unlock\n"; print "To Exit Press 0\n"; print "=====================================\n\n\n"; Lookup(); print "0 ) Exit\n\n"; $choice = <stdin>; if ($choice > 0) { unlock(); } } if ($choice == 4) { $location = "Union"; system(cls); print "Select The User you wish to Unlock\n"; print "To Exit Press 0\n"; print "=====================================\n\n\n"; Lookup(); print "0 ) Exit\n\n"; $choice = <stdin>; if ($choice > 0) { unlock(); } } if ($choice == 5) { $location = "Main"; system(cls); print "Select The User you wish to Unlock\n"; print "To Exit Press 0\n"; print "=====================================\n\n\n"; Lookup(); print "0 ) Exit\n\n"; $choice = <stdin>; if ($choice > 0) { unlock(); } } if ($choice == 6) { $location = "Labadie"; system(cls); print "Select The User you wish to Unlock\n"; print "To Exit Press 0\n"; print "=====================================\n\n\n"; Lookup(); print "0 ) Exit\n\n"; $choice = <stdin>; if ($choice > 0) { unlock(); } } }

In reply to Re^3: Web-based LDAP User Accounts System by SteveS832001
in thread Web-based LDAP User Accounts System by James Board

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.