In the Win32::NetAdmin module i am going to use the UserSetAttributes to change the administrator password, however...there is alot of other fields that i do not wish to use...example the man page shows
UserSetAttributes(server, username, password, passwordAge,privilege,homeDir, comment, flags, scriptPath).
I only need to use the first 3. is there a way to specify that or do i have to assign values to the rest of them.
Any help would be appreciated.
Ray
# Ray Espinoza
# ChPass.pl
# TO change local admin pass on remote machine
####################################################
#!D:\perl\bin -w
use strict;
use Win32::NetAdmin qw(SetUserAttributes);
chomp(my $server = <STDIN>);
my $userAcct = "Administrator";
my $Pass = "387SetHike";
UserSetAttributes($server, $userAcct, $Pass) ||
die "UserSetAttributes() failed: $^E";
I get this error when i try to run this:
"SetUserAttributes" is not exported by the Win32::NetAdmin module at C
+:\
perl\ChPass.pl line 9
Can't continue after import errors at C:\scripts\perl\ChPass.pl line 9
BEGIN failed--compilation aborted at C:\scripts\perl\ChPass.pl line 9.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.