Thank you very much for the reply, but I still have the same question.  What
value do I set $scriptPath to so that it will delete the existing value in
UMFD?  Neither undef, " ", "" or anything else I have tried mimics the
manual action of entering UMFD and deleting the existing value.  Thanks
again.


> -----Original Message-----
> From: Chuck Lawhorn [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, May 15, 2001 2:30 PM
> To:   Ryan, David; '[EMAIL PROTECTED]'
> Subject:      Re: Delete Logon Script Name in UMFD
> 
> Using Win32::Lanman, read all the information for a user into a hash. Then
> change the value of the
> login script hash variable if it is equal to the one you are looking for.
> Then write the hash back
> to the user attributes. Win32::Lanman prefers strongly that you set all
> the values of the user
> attributes hash when writing them back.
> 
> Hope this helps,
> 
> --Chuck
> 
> 
> --- "Ryan, David" <[EMAIL PROTECTED]> wrote:
> > 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
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin

Reply via email to