I am trying to delete the value for Logon Script Name in User Manager for
Domains if a user has allusers.bat for a logon script.  I can change it to
anything through the following script (junk, space character, etc.), but
cannot duplicate the manual keystrokes of deleting the current value
(allusers.bat in this case).  Any help would be appreciated (specifically, I
need help with the #*** commented line below):
----------------------------------------------------------------------------
------------
#! /usr/bin/perl

use Win32::NetAdmin qw(GetUsers GroupIsMember
  UserGetAttributes UserSetAttributes);

my %hash;

GetUsers("", FILTER_NORMAL_ACCOUNT , \%hash)
  or die "GetUsers() failed: $^E";

foreach (keys %hash) {
  my ($password, $passwordAge, $privilege,
    $homeDir, $comment, $flags, $scriptPath);
  UserGetAttributes("", $_, $password, $passwordAge, $privilege, $homeDir,
      $comment, $flags, $scriptPath) or die "UserGetAttributes() failed:
$^E";
  if ($scriptPath ne "allusers.bat") { 
    #*** undef $scriptPath doesn't work; $scriptPath = " " doesn't work;
$scriptPath = "" doesn't work;***# 
    UserSetAttributes("", $_, $password, $passwordAge, $privilege, $homeDir,
      $comment, $flags, undef $scriptPath) or die "UserSetAttributes()
failed: $^E";
  } 
}

_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin

Reply via email to