I would like to get a consensus from the group on the best / preferred
method for detecting a connection to the domain for which a computer is a
member of.

I am going to write a script that runs at startup for laptop users that
will check for a connection to the domain and exit if present. If not
present, it will sit in an endless loop watching for a connection and then
perform some tasks (map drives, check password expiration, etc) upon
connection. I am considering pinging a known server. I am also considering
using 'Scripting.FileSystemObject's' 'FolderExists' method to check for the
DFS root. Which of these two methods would be the preferred method and are
there other, better methods?

Re: Domain connection detection by Al

Al
Mon May 05 21:30:58 CDT 2008

We did something like that, but using a custom .exe rather than a script. I
do not know how it determines the presence of our network, but I will try to
track down the developer and ask him.

/Al

"James Whitlow" <jwhitlow.60372693@bloglines.com> wrote in message
news:OelAj$rrIHA.4544@TK2MSFTNGP04.phx.gbl...
> I would like to get a consensus from the group on the best / preferred
> method for detecting a connection to the domain for which a computer is a
> member of.
>
> I am going to write a script that runs at startup for laptop users that
> will check for a connection to the domain and exit if present. If not
> present, it will sit in an endless loop watching for a connection and then
> perform some tasks (map drives, check password expiration, etc) upon
> connection. I am considering pinging a known server. I am also considering
> using 'Scripting.FileSystemObject's' 'FolderExists' method to check for
> the DFS root. Which of these two methods would be the preferred method and
> are there other, better methods?
>



Re: Domain connection detection by James

James
Mon May 05 21:54:19 CDT 2008

"Al Dunbar" <AlanDrub@hotmail.com.nospaam> wrote in message
news:ORC5YFyrIHA.3680@TK2MSFTNGP05.phx.gbl...
> We did something like that, but using a custom .exe rather than a script.
> I do not know how it determines the presence of our network, but I will
> try to track down the developer and ask him.

Thanks, Al. I look forward to the information!

I would like to use the most reliable and lightest weight method
possible.



Re: Domain connection detection by Al

Al
Sat May 10 11:16:16 CDT 2008


"James Whitlow" <jwhitlow.60372693@bloglines.com> wrote in message
news:u1yW%23RyrIHA.2492@TK2MSFTNGP06.phx.gbl...
> "Al Dunbar" <AlanDrub@hotmail.com.nospaam> wrote in message
> news:ORC5YFyrIHA.3680@TK2MSFTNGP05.phx.gbl...
>> We did something like that, but using a custom .exe rather than a script.
>> I do not know how it determines the presence of our network, but I will
>> try to track down the developer and ask him.
>
> Thanks, Al. I look forward to the information!
>
> I would like to use the most reliable and lightest weight method
> possible.

I made some enquiries, but have yet to find out who might have this
information - sorry.

/Al



Re: Domain connection detection by James

James
Sat May 10 13:16:32 CDT 2008

"Al Dunbar" <AlanDrub@hotmail.com.nospaam> wrote in message
news:OF8gMBssIHA.4876@TK2MSFTNGP02.phx.gbl...
>
> "James Whitlow" <jwhitlow.60372693@bloglines.com> wrote in message
> news:u1yW%23RyrIHA.2492@TK2MSFTNGP06.phx.gbl...
>> "Al Dunbar" <AlanDrub@hotmail.com.nospaam> wrote in message
>> news:ORC5YFyrIHA.3680@TK2MSFTNGP05.phx.gbl...
>>> We did something like that, but using a custom .exe rather than a
>>> script. I do not know how it determines the presence of our network, but
>>> I will try to track down the developer and ask him.
>>
>> Thanks, Al. I look forward to the information!
>>
>> I would like to use the most reliable and lightest weight method
>> possible.
>
> I made some enquiries, but have yet to find out who might have this
> information - sorry.

Thanks for trying! I am thinking about using two loops. The first loop
with just try a ping every few seconds. If the ping succeeds, then use the
'FolderExists' method of FSO to check for the DFS root. The looping ping
should be very lightweight (correct me if I am wrong) and the second part
will verify it really is our network they connected to.

Does this appear like a reasonable approach? I am open to constructive
criticism!



Re: Domain connection detection by Al

Al
Sun May 11 11:53:02 CDT 2008


"James Whitlow" <jwhitlow.60372693@bloglines.com> wrote in message
news:uVJv8nssIHA.3780@TK2MSFTNGP03.phx.gbl...
> "Al Dunbar" <AlanDrub@hotmail.com.nospaam> wrote in message
> news:OF8gMBssIHA.4876@TK2MSFTNGP02.phx.gbl...
>>
>> "James Whitlow" <jwhitlow.60372693@bloglines.com> wrote in message
>> news:u1yW%23RyrIHA.2492@TK2MSFTNGP06.phx.gbl...
>>> "Al Dunbar" <AlanDrub@hotmail.com.nospaam> wrote in message
>>> news:ORC5YFyrIHA.3680@TK2MSFTNGP05.phx.gbl...
>>>> We did something like that, but using a custom .exe rather than a
>>>> script. I do not know how it determines the presence of our network,
>>>> but I will try to track down the developer and ask him.
>>>
>>> Thanks, Al. I look forward to the information!
>>>
>>> I would like to use the most reliable and lightest weight method
>>> possible.
>>
>> I made some enquiries, but have yet to find out who might have this
>> information - sorry.
>
> Thanks for trying! I am thinking about using two loops. The first loop
> with just try a ping every few seconds. If the ping succeeds, then use the
> 'FolderExists' method of FSO to check for the DFS root. The looping ping
> should be very lightweight (correct me if I am wrong) and the second part
> will verify it really is our network they connected to.
>
> Does this appear like a reasonable approach? I am open to constructive
> criticism!

The most appropriate/efficient approach may depend on the methods involved
in establishing your connection into your network. But here's a thought:
perhaps there is something local to the PC itself that can be queried to
find out when such a connection has been established.

I just captured the output of the ipconfig/all command just before and just
after establishing the vpn connection, and found that the name of my ISP
disappeared from the "DNS suffix search list", being replaced by the netbios
name of our domain, i.e.:

before:
xxxxx.gc.ca
ed.shawcable.net
gc.ca

after:
xxxxx.gc.ca
XXXXX
gc.ca

/Al



Re: Domain connection detection by Dominic

Dominic
Mon May 12 06:46:31 CDT 2008

You could consider something like:

Set oRootDSE = GetObject("LDAP://mydomain.com/RootDSE")
strDNC = oRootDSE.get("DefaultNamingContext")

to determine if the specific domain is available rather than another
service.It should also have the advantage of allowing any domain
controller to respond and you won't rely on a specific device
responding to the ping. I think it's a relatively lightweight
approach.

If the domain is available perhaps you could use the UserName property
of ADSystemInfo to check if the user has already logged onto the
domain.

Any use?

Dominic

Re: Domain connection detection by James

James
Mon May 12 07:40:48 CDT 2008

"Dominic Johnson" <johnsondominic@hotmail.com> wrote in message
news:70d692d0-dae8-4731-8af2-431302938644@c65g2000hsa.googlegroups.com...
> You could consider something like:
>
> Set oRootDSE = GetObject("LDAP://mydomain.com/RootDSE")
> strDNC = oRootDSE.get("DefaultNamingContext")
>
> to determine if the specific domain is available rather than another
> service.It should also have the advantage of allowing any domain
> controller to respond and you won't rely on a specific device
> responding to the ping. I think it's a relatively lightweight
> approach.
>
> If the domain is available perhaps you could use the UserName property
> of ADSystemInfo to check if the user has already logged onto the
> domain.
>
> Any use?

I appreciate the suggestion offered by both you and Al Dunbar. When time
permits, I am going to do a little testing with both methods to see which
one will work best for me. I am going to put the chosen method into a
function returning 'True' or 'False'. This should help me swap between them
for testing.

My thanks to both of you for your excellent suggestions!