Re: Program to fetch user information

[email protected] (Rob Dixon)
Newsgroups perl.beginners
Message-ID <[email protected]>
Gunwant Singh wrote:
> 
> I have written a small Perl script so to fetch information about the 
> user. Here is the code:
> 
> /1    use strict;
> 2    use warnings;
> 3    use Win32::Netadmin;
> 4    Win32::NetAdmin::UserGetAttributes(my $server,my $userName,my 
> $password,my $passwordAge,my $privilege,my $homeDir,my $comment,my
>      $flags,my $scriptPath);
> 5    print "The homedir for the user is $homeDir\n";/
> 
> When I tried to run it, I got this:
> 
> /Use of uninitialized value in subroutine entry at C:\Documents and 
> Settings\Myself\Desktop\code\mac-info.pl line 4.
> Use of uninitialized value in subroutine entry at C:\Documents and 
> Settings\Myself\Desktop\code\mac-info.pl line 4.
> Use of uninitialized value in concatenation (.) or string at 
> C:\Documents and Settings\Myself\Desktop\code\mac-info.pl line 5.
> The homedir for the user is/
> 
> I am not sure, what is the problem. Can anyone help me on this?

You need to specify the server and user name.

Win32::NetAdmin::UserGetAttributes('', 'Rob',
  $password, $passwordAge,
  $privilege, $homeDir, $comment, $flags, $scriptPath);

HTH,

Rob
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.