Wim,
Try using something like this. It seems to me I remember a NT 4.0 ResKit utility
which did something similar.
James
use Win32::Lanman;
$Domain="MyDomain";
Win32::Lanman::NetGetDCName("", $Domain, \$PDC);
Win32::Lanman::NetServerEnum($PDC, $Domain, SV_TYPE_DOMAIN_BAKCTRL |
SV_TYPE_DOMAIN_CTRL, [EMAIL PROTECTED]);
Win32::Lanman::NetUserEnum($Domain, &FILTER_NORMAL_ACCOUNT, [EMAIL PROTECTED]);
foreach $Account (@Accounts){
foreach $DC (@DCList){
Win32::Lanman::NetUserGetInfo(${$DC}{'name'}, ${$Account}{'name'},
\%info);
print
"${$Account}{'name'}\t$$DC{'name'}\t".localtime($info{'last_logon'})."\n";
}
}
-----Original Message-----
From: VANHERP Wim <[EMAIL PROTECTED]>
To: "'[EMAIL PROTECTED]'"
<[EMAIL PROTECTED]>
Subject: FW: user info with win32::lanman
Date: Mon, 30 Jun 2003 11:41:03 +0200
The problem is that you have to fill in the PDC to get the userlist of a
domain,
if you fill in another server or domaincontroller you don't get the info of
the users
Win32::Lanman::NetUserEnum($PDC,[EMAIL PROTECTED]) works only with the PDC
Wim Vanherp
tel : 5100
GSM :0478 88 32 03
> ----------
> From: Krummel, James C - PGGC-6[SMTP:[EMAIL PROTECTED]
> Sent: maandag 30 juni 2003 7:32
> To: '[EMAIL PROTECTED]'
> Subject: RE: user info with win32::lanman
>
>
> Wim,
>
> The last_logon parameter is only set on the domain controller that the
> account has logged on to, and is not tracked by the domain. You would
> need to check each and every domain controller in your domain looking for
> the most recent value to determine the last logon.
>
> James Krummel
>
> -----Original Message-----
> From: VANHERP Wim <[EMAIL PROTECTED]>
> To: "'[EMAIL PROTECTED]'"
> <[EMAIL PROTECTED]>
> Subject: user info with win32::lanman
> Date: Fri, 27 Jun 2003 11:28:17 +0200
>
> I use lanman to get info about users on the domain, i want to replace
> profiles so first i want to see if the user is logged in, and if he is not
> logged in, i can move the profile. when i check the last_logon and
> last_logon parameters i get values that does not seem to be correct ( i
> checked my own user, logged in and out and the values stayed the same).
>
> Does anyone know how to check this properly ?
>
>
> Wim Vanherp
> tel : 5100
> GSM :0478 88 32 03
> _______________________________________________
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs