[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl-win32-admin
Subject:    Re: Logon Script: How to obtain %LOGONSERVER% and %COMPUTERNAME%
From:       "Jenda Krynicky" <Jenda () Krynicky ! cz>
Date:       2001-05-30 14:44:34
[Download RAW message or body]

> Thanks to all who replied to my "Running Perl as a Logon Script" post
> (during the testing phase, Perl is installed on a few clients.  Once I can
> prove this works, I will then get management's OK to install Perl on the
> domain controllers).  Wrapping the .pl in a .bat resolved my issue.
> 
> I have one other question related to this...In the logon script I am using
> %LOGONSERVER% to determine which domain controller authenticated the client,

The easiest and quickest solution (IMHO) is to find out where is Z: 
connected to. :

	use Win32::FileOp;
	$server =  Mapped 'Z:';
	$server =~ s{^(\\\\[^\\]+)\\.*$}{$1};
	# this will NOT work under WinNT and Win2k. They do NOT map the Z:
	# during login

> and %COMPUTERNAME% to determine the name of the client.  

	use Win32;
	$client = '\\\\' . Win32::NodeName()

Jenda 

== Jenda@Krynicky.cz == http://Jenda.Krynicky.cz ==
: What do people think?
What, do people think?  :-)
             -- Larry Wall in <199808071736.KAA12738@wall.org>
_______________________________________________
Perl-Win32-Admin mailing list
Perl-Win32-Admin@listserv.ActiveState.com
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic