I don't know why but contrary to Dave's belief, I had to set this up this
way to make it work, where the first line is the last few hours on Sunday
and then the next lines are Monday, Tuesday, etc...
%Logon_Hours = ('special' =>
[(1,0,0,0,0,0,0,
0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,
)],
'normal' =>
[(1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
)],
);
my $packed_hours = pack ( 'b*' ,
join('',@{$Logon_Hours{$hours_identifier}}) ) ;
if (Win32::AdminMisc::UserSetMiscAttributes ($pdc, $username,
USER_LOGON_HOURS =>
$packed_hours )) {
print " Succeeded setting Logon Hours for $username!\n";
} else {
print " Failed setting Logon Hours for $username!\nERROR:
",Win32::GetLastError(),"\n";
}
Steven
-----Original Message-----
From: DePriest, Jason R. [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 24, 2002 1:55 PM
To: Perl-Win32-Admin ([EMAIL PROTECTED])
Subject: Win32::AdminMisc - user flag USER_LOGON_HOURS
Dave Roth's documentation and website say this value points to a 21-byte
(168-bit) binary string in which each bit represents one hour of the week.
Has anyone bothered to parse this flag out into english? The only way I can
think of is to write a pseudo-switch statement with a 168 'if' statements
that push the results into an array.
Plus, if I 'ord' the value from the flag (and no restrictions are set), I
get 255 and not 2E+167.
Thank you!
Jason R DePriest
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs