Hi

The logon script we use at work works great when users are at the
office. But when at home and connected to our network through a VPN
tunnel (Netscreen Remote tunnel), the script is unable to detect the
domain name, the current user and the current computer. Currently we
detect those using the following VBScript code (cleaned up to save
space):

--------------------------------------

Dim strDomain
Dim objADSystemInfo: Set objADSystemInfo =
CreateObject("ADSystemInfo")

' AD info
strDomain = objADSystemInfo.DomainDNSName

' User account
Set objUser = GetObject("LDAP://" & strDomain & "/" &
objADSystemInfo.UserName)

' Computer account
Set objComputer = GetObject("LDAP://" & strDomain & "/" &
objADSystemInfo.ComputerName)

--------------------------------------

Is there another way to detect these things?

Best regards,
Egil.

Re: Detecting domain/user/computer through VPN tunnel/connection by Egil

Egil
Wed Jun 20 03:33:31 CDT 2007

Update:

It looks like my my problem lies in actually getting in contact with
the PDC and performing LDAP queries.

Even if I hard code the distinguished name I'm still turned down:

Set objUser = GetObject("LDAP://
CN=Administrator,CN=Users,DC=xxxxxxx,DC=yyy")
WScript.Echo "sAMAccountName = " & objUser.sAMAccountName

If I run the above code, I get a "The specified domain either does not
exist or could not be contacted."

I have updated my lmhost in accordance to
http://support.microsoft.com/default.aspx?scid=kb;EN-US;180094 - and
indeed I'm able to ping my PDC on both ip and dns name/hostname.

Is there any other tricks I haven't tried that might work?

Best regards, Egil.