Hello all,
I have Windows 2003 FTP servers that I store content on for external
users to pick up on a schedule. Unfortunately I have about 300 of
such users, and multiple servers. The time and energy to create these
user accounts is obviously a factor, especially if I have to rebuild a
box and have it up and running quickly.
So, I went looking for Perl scripts / modules that could do this, but
all I came up with was some old (for NT4) ones that used
Win32::Lanman. I'm not creating domain (Active Directory) accounts,
just local ones on the box. I have the users in a comma-delimited
file, and really just need a shove in the right direction.
Any suggestions would be most appreciated.
|
|
0
|
|
|
|
Reply
|
rev_maynard3
|
6/22/2004 9:33:29 PM |
|
Maynard wrote:
> Hello all,
>
> I have Windows 2003 FTP servers that I store content on for external
> users to pick up on a schedule. Unfortunately I have about 300 of
> such users, and multiple servers. The time and energy to create these
> user accounts is obviously a factor, especially if I have to rebuild a
> box and have it up and running quickly.
>
> So, I went looking for Perl scripts / modules that could do this, but
> all I came up with was some old (for NT4) ones that used
> Win32::Lanman. I'm not creating domain (Active Directory) accounts,
> just local ones on the box. I have the users in a comma-delimited
> file, and really just need a shove in the right direction.
>
> Any suggestions would be most appreciated.
What's wrong with Win32::Lanman? AFAIK it should work under W2k+3.
Alternatively use Win32::OLE to do it via the WMI interface.
Thomas
--
open STDIN,"<&DATA";$=+=14;$%=50;while($_=(seek( #J~.> a>n~>>e~.......>r.
STDIN,$:*$=+$,+$%,0),getc)){/\./&&last;/\w| /&&( #.u.t.^..oP..r.>h>a~.e..
print,$_=$~);/~/&&++$:;/\^/&&--$:;/>/&&++$,;/</ #.>s^~h<t< ..~. ...c.^..
&&--$,;$:%=4;$,%=23;$~=$_;++$i==1?++$,:_;}__END__#....>>e>r^..>l^...>k^..
|
|
0
|
|
|
|
Reply
|
Thomas
|
6/23/2004 9:16:08 AM
|
|
rev_maynard3@hotmail.com (Maynard) wrote in message news:<a4847dc.0406221333.227bc2c7@posting.google.com>...
> Hello all,
>
> I have Windows 2003 FTP servers that I store content on for external
> users to pick up on a schedule. Unfortunately I have about 300 of
> such users, and multiple servers. The time and energy to create these
> user accounts is obviously a factor, especially if I have to rebuild a
> box and have it up and running quickly.
>
> So, I went looking for Perl scripts / modules that could do this, but
> all I came up with was some old (for NT4) ones that used
> Win32::Lanman. I'm not creating domain (Active Directory) accounts,
> just local ones on the box. I have the users in a comma-delimited
> file, and really just need a shove in the right direction.
>
> Any suggestions would be most appreciated.
Win32::NetAdmin. Available on CPAN.
(The name is derived from the corresponding Win32 API calls)
Regards,
Dan
|
|
0
|
|
|
|
Reply
|
djberg96
|
6/23/2004 5:13:01 PM
|
|
Maynard wrote:
> Hello all,
>
> I have Windows 2003 FTP servers that I store content on for external
> users to pick up on a schedule. Unfortunately I have about 300 of
> such users, and multiple servers. The time and energy to create these
> user accounts is obviously a factor, especially if I have to rebuild a
> box and have it up and running quickly.
>
> So, I went looking for Perl scripts / modules that could do this, but
> all I came up with was some old (for NT4) ones that used
> Win32::Lanman. I'm not creating domain (Active Directory) accounts,
> just local ones on the box. I have the users in a comma-delimited
> file, and really just need a shove in the right direction.
>
> Any suggestions would be most appreciated.
Win32::Lanman is really nice as I recall, and I think it's had some
updating done since WNT 4.0. Almost positive. Anyway, I'm recalling my
thoughts from about 2-3 years back.
I think if you depend on the ActiveState documentation (assuming that is
what you are using, which it is almost sure to be), it may take you some
time to come to grips with actually pulling it off. Again, as I recall,
it took some time experimenting before I got user adds (deletes, etc.)
exactly right.
Enclosed is a snippet which might help. Some extraneous lines removed.
Just view the hash reference passed in as a data structure holding the
relevant information I had gathered before calling the Win32API::Net
module (is what I chose at the time for doing my adds). This shouldn't
be too hard to follow:
(I know you want just a local machine add -- but keep reading)
use Win32API::Net qw( :User );
sub AddUserToDomain {
## Get parameters.
my $req = shift; # A request hash reference
## Load up local info hash needed by UserAdd, GetInfo, etc.
my $h = {
name => $req->{userid},
password => $req->{password},
passwordAge => 0,
priv => USER_PRIV_USER(),
homeDir => $req->{homedir},
comment => $req->{comment},
flags => (UF_SCRIPT & UF_NORMAL_ACCOUNT),
scriptPath => $req->{loginscript},
authFlags => 0,
fullName => $req->{fullname},
usrComment => $req->{comment},
parms => $Script{DESC},
workstations => '',
lastLogon => 0,
lastLogoff => 0,
acctExpires => -1,
maxStorage => -1,
unitsPerWeek => 0,
logonHours => [ 0x0F, 0x0F, 0x0F,
0x0F, 0x0F, 0x0F,
0x0F, 0x0F, 0x0F,
0x0F, 0x0F, 0x0F,
0x0F, 0x0F, 0x0F,
0x0F, 0x0F, 0x0F,
0x0F, 0x0F, 0x0F, ],
badPwCount => 0,
numLogons => 0,
logonServer => '',
countryCode => 0,
codePage => 0,
userId => 0,
primaryGroupId => 0x201,
profile => $req->{userprofile},
homeDirDrive => $req->{homedrive},
passwordExpired => $req->{expirepwd},
};
## Add the user and get the return value.
## (This is Win32API::Net::UserAdd())
my $rv = 0; # Return value (assume OK)
UserAdd( $req->{pdc}, 3, $h, $rv ); # Add the user
## Return success or error code.
$rv;
}
__END__
I believe $Script{DESC} above was just some descriptive text about the
script running which ended up in the record of the user account created.
Something like that. Now that I look, I see the examples in
Win32API::Net are a bit more descriptive than Win32::NetAdmin.
I believe if you substitute the name of your local machine
($ENV{COMPUTERNAME}) with the "$req->{pdc}" above, this will work for a
local machine add? Sorry, I don't have time to test this in that scenario.
HTH,
-ceo
|
|
0
|
|
|
|
Reply
|
ChrisO
|
6/24/2004 3:33:37 AM
|
|
Thomas Kratz <ThomasKratz@REMOVEwebCAPS.de> wrote in message news:<40d94a58$0$14527$bb690d87@news.main-rheiner.de>...
> Maynard wrote:
> > Hello all,
> >
> > I have Windows 2003 FTP servers that I store content on for external
> > users to pick up on a schedule. Unfortunately I have about 300 of
> > such users, and multiple servers. The time and energy to create these
> > user accounts is obviously a factor, especially if I have to rebuild a
> > box and have it up and running quickly.
> >
> > So, I went looking for Perl scripts / modules that could do this, but
> > all I came up with was some old (for NT4) ones that used
> > Win32::Lanman. I'm not creating domain (Active Directory) accounts,
> > just local ones on the box. I have the users in a comma-delimited
> > file, and really just need a shove in the right direction.
> >
> > Any suggestions would be most appreciated.
>
> What's wrong with Win32::Lanman? AFAIK it should work under W2k+3.
> Alternatively use Win32::OLE to do it via the WMI interface.
>
> Thomas
Can you provide a link for Win32::Lanman? It's not on CPAN, and I
couldn't seem to find it on roth.net. Is it part of a larger package
that I'm missing? Google had lots of references to it, but no place
to actually download it.
As for WMI, I don't think you can create user accounts with it. You
can only list them. Please correct me if I'm wrong.
Regards,
Dan
|
|
0
|
|
|
|
Reply
|
djberg96
|
6/25/2004 1:40:59 PM
|
|
Daniel Berger wrote:
> Thomas Kratz <ThomasKratz@REMOVEwebCAPS.de> wrote in message news:<40d94a58$0$14527$bb690d87@news.main-rheiner.de>...
>
>>Maynard wrote:
>>
>>>Hello all,
>>>
>>>I have Windows 2003 FTP servers that I store content on for external
>>>users to pick up on a schedule. Unfortunately I have about 300 of
>>>such users, and multiple servers. The time and energy to create these
>>>user accounts is obviously a factor, especially if I have to rebuild a
>>>box and have it up and running quickly.
>>>
>>>So, I went looking for Perl scripts / modules that could do this, but
>>>all I came up with was some old (for NT4) ones that used
>>>Win32::Lanman. I'm not creating domain (Active Directory) accounts,
>>>just local ones on the box. I have the users in a comma-delimited
>>>file, and really just need a shove in the right direction.
>>>
>>>Any suggestions would be most appreciated.
>>
>>What's wrong with Win32::Lanman? AFAIK it should work under W2k+3.
>>Alternatively use Win32::OLE to do it via the WMI interface.
>>
>>Thomas
>
>
> Can you provide a link for Win32::Lanman? It's not on CPAN, and I
> couldn't seem to find it on roth.net. Is it part of a larger package
> that I'm missing? Google had lots of references to it, but no place
> to actually download it.
It's on CPAN, but doesn't follow the usual naming conventions und I think
this prevents search.cpan.org from finding it. Look in:
http://cpan.org/modules/by-authors/id/J/JH/JHELBERG/
or
http://cpan.org/modules/by-module/Win32/
the filename is 'lanman.1.0.10.0.zip'
It includes the source without supporting the standard procedure ( perl
makefile.pl, make, make test, make install), but I could compile it easily
with MSV6. There are even compiled versions with a ppd file included.
>
> As for WMI, I don't think you can create user accounts with it. You
> can only list them. Please correct me if I'm wrong.
You are right, I suppose. You can do it with ADSI though. Look at
http://www.microsoft.com/technet/community/scriptcenter/user/default.mspx
The VB syntax is easily translatable to Perl and Win32::OLE.
Thomas
--
open STDIN,"<&DATA";$=+=14;$%=50;while($_=(seek( #J~.> a>n~>>e~.......>r.
STDIN,$:*$=+$,+$%,0),getc)){/\./&&last;/\w| /&&( #.u.t.^..oP..r.>h>a~.e..
print,$_=$~);/~/&&++$:;/\^/&&--$:;/>/&&++$,;/</ #.>s^~h<t< ..~. ...c.^..
&&--$,;$:%=4;$,%=23;$~=$_;++$i==1?++$,:_;}__END__#....>>e>r^..>l^...>k^..
|
|
0
|
|
|
|
Reply
|
Thomas
|
6/25/2004 2:38:21 PM
|
|
|
5 Replies
3229 Views
(page loaded in 0.146 seconds)
Similiar Articles: how do i list all user accounts that have expired? - comp.unix ...is there a way to list all user accounts ... 13 00:00:00 2000 I'm not a perl ... of expired Active Directory user accounts ?, Windows Server Help, Windows 2000 // 2003 ... Password Batch Utility - comp.sys.hp.hpux... there's a perl module that provides the same functionality using ... pdf Hi, I am using Adobe Acrobat 8 Standard on Windows ... or batch file using a different user account ... Opening a file with case-insensitive name - comp.lang.perl.misc ...... seem to indicate that you are using some sort of Windows. ... read the directory and create a hash from it, using the ... insensitive name - comp.lang.perl.misc ..... the user ... Create direcotry recursively - comp.unix.programmer... into account, your asssessment seems somewhat .... strange ... except if one is willing to make a few of the usual assumption, namely, that 'dead' (to a Windows user ... Help - Small school lab - do I need a Server? - comp.os.ms-windows ...If you need user accounts, a Windows "domain" will make things MUCH easier (centrally managed). ... the following: > > Dell server, with RAID drives and Windows 2003 25 user ... Shibboleth IDP and mixed Windows 2003/2008 AD servers - comp ...Shibboleth IDP and mixed Windows 2003/2008 AD ... the password for the test account (always to the same password) and then using a ... We're not getting reports of user ... password expiration check script - comp.unix.solarisYou could parse this file with perl and ... expiration #!/bin/sh #rsj 01/16/2003 #this ... expiration - extend - comp.os.ms-windows ... how do i list all user accounts that ... web application: how to get the currently logged in user? - comp ...... of the currently logged in user (system login on a windows ... from SYSTEM account - comp.os.ms-windows ... web ... the list of groups given a user id - comp.lang.perl ... Getting directory sizes on win32 - comp.lang.perl.miscOn 3 Sep 2003 14:04:18 -0700 deaduser@hotmail.com ... Getting directory sizes on win32 - comp.lang.perl.misc Hi, I am using ... more Vista/7 compatible - comp.os.ms-windows ... comp ... FreeBSD 8 and Winbind via pam_krb5 - comp.unix.bsd.freebsd.misc ...... of you use FreeBSD in Windows ... or SSH to do so, you can create a simple test harness using this Perl ... so ... login count in ... user logs ... ... Use of Domain Accounts ... Creating user and group accounts: GeneralCreating user and group accounts. Updated: March 25, 2011. Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows ... Create Windows NT domain user accounts from command-lineAdmin Tips. Windows Server 2008/2003/2000/XP/NT Administrator Knowledge Base. Windows NT. Admin Tips. Network. Create Windows NT domain user accounts from command-line 7/23/2012 7:33:05 AM
|