The following snippet is from a script that manages who can 'Access This
Computer From the Network'. LsaLookupSids sometimes returns domain names
with a question mark ( DOMAIN?\USER ). Has anyone seen this or know what
may cause it?
Thanks,
Tony O
use Win32::Lanman;
my @sids;
if( not Win32::Lanman::LsaEnumerateAccountsWithUserRight( "
\\\\$ENV{COMPUTERNAME}", &SE_NETWORK_LOGON_NAME, \@sids ) ) {
print ATCFNLOG "LsaEnumerateAccountsWithUserRight; ";
my $error = Win32::Lanman::GetLastError();
print ATCFNLOG "ERROR $error: ", Win32::FormatMessage( $error );
die "\n";
}
my @Accounts;
if( not Win32::Lanman::LsaLookupSids( "\\\\$ENV{COMPUTERNAME}", \@sids,
\@Accounts ) ){
print ATCFNLOG "LsaLookupSids; ";
my $error = Win32::Lanman::GetLastError();
print ATCFNLOG "ERROR $error: ", Win32::FormatMessage( $error );
die "\n";
}
my ( $Acct, %Existing );
foreach $Acct (@Accounts){
if ( defined $$Acct{domain} && defined $$Acct{name} ){
print "$$Acct{domain}\\$$Acct{name}\n";
}elsif ( defined $$Acct{name} ){
print "$$Acct{name}\n";
}
}
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs