Sensing domain logon

  • Thread starter Thread starter William Hymen
  • Start date Start date
W

William Hymen

How would I script mapping to network
drives based on being on or off the network? (doman logon)
Since Windows 2k caches the credentials, I need
to check if the user is "roaming" off-line.

Could the %logonserver% or %userdomain%
be tested? Or is their a cleaner way?

Thanks in advance.
Bill
 
William said:
How would I script mapping to network
drives based on being on or off the network? (doman logon)
Since Windows 2k caches the credentials, I need
to check if the user is "roaming" off-line.

Could the %logonserver% or %userdomain%
be tested? Or is their a cleaner way?

Hi

If the %logonserver% is \\<local computer name>, the user has logged on
with cached credentials...


--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of the 1328 page
Scripting Guide:
http://www.microsoft.com/technet/community/scriptcenter/default.mspx
 
On Mon, 08 Mar 2004 00:35:31 GMT, "William Hymen"
comp.os.ms-windows.nt.admin.networking,
microsoft.public.win2000.cmdprompt.admin:
How would I script mapping to network
drives based on being on or off the network? (doman logon)
Since Windows 2k caches the credentials, I need
to check if the user is "roaming" off-line.

Could the %logonserver% or %userdomain%
be tested? Or is their a cleaner way?

I don't follow. If the user is not connected to the network (and thus
logs in with cached credentials), no domain based logon script (AD or
otherwise) is run. Thus the script doesn't have to make a decision
whether or not to map; by definition, when the logon script gets
executed, the user is connected to the network.
 
In said:
On Mon, 08 Mar 2004 00:35:31 GMT, "William Hymen"
comp.os.ms-windows.nt.admin.networking,
microsoft.public.win2000.cmdprompt.admin:


I don't follow. If the user is not connected to the network (and
thus logs in with cached credentials), no domain based logon
script (AD or otherwise) is run. Thus the script doesn't have to
make a decision whether or not to map; by definition, when the
logon script gets executed, the user is connected to the network.

Could be running local "logon" scripts.
Could be an application startup script.
 
Michael Bednarek said:
On Mon, 08 Mar 2004 00:35:31 GMT, "William Hymen"
comp.os.ms-windows.nt.admin.networking,
microsoft.public.win2000.cmdprompt.admin:


I don't follow. If the user is not connected to the network (and thus
logs in with cached credentials), no domain based logon script (AD or
otherwise) is run. Thus the script doesn't have to make a decision
whether or not to map; by definition, when the logon script gets
executed, the user is connected to the network.

You are assuming that the OP is asking how to do this in a logon script. But
he *might* want to distribute scripts to the clients that they can run
manually to acquire share connections. Perhaps he has already found out that
the domain logon script does not when his users log on with cached
credentials, and he is providing the share mapping functionality in these
scripts.

In that case, there should be no issue, as the following two pseudo-code
scripts should have the same effect:

1) clairvoyant approach:

if not on the network then
msgbox "cant connect"
else
WNO.mapnetworkdrive whatever...
end if

2) practical approach

on error resume next
WNO.mapnetworkdrive whatever...
if err then
msgbox "cant connect"
end if

/Al
 
Back
Top