Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to get the current Domain Name from VBScript ?

2,460 views
Skip to first unread message

Nicolas Quentin (France)

unread,
Jul 2, 1999, 3:00:00 AM7/2/99
to
Hi !

I'd like to get the current Domain Name from a OL97 custom Form ?
Does someone has an idea ?


Thanks for your help

Michael Harris

unread,
Jul 2, 1999, 3:00:00 AM7/2/99
to
Set Network = CreateObject("WScript.Network")
Domain = Network.UserDomain


--
Michael Harris

Nicolas Quentin (France) <nico...@hotmail.com> wrote in message
news:377CD2...@hotmail.com...

DVD Review

unread,
Jul 3, 1999, 3:00:00 AM7/3/99
to

Nicolas Quentin (France) wrote in message <377CD2...@hotmail.com>...

>Hi !
>
>I'd like to get the current Domain Name from a OL97 custom Form ?
>Does someone has an idea ?
>
>
>Thanks for your help


You should be able to obtain this through the browser properties.

Try this in your script

host = Top.Location.host
hostname = Top.Location.hostname
href = Top.Location.href

This should work.

Guido Henkel

Michael Harris

unread,
Jul 6, 1999, 3:00:00 AM7/6/99
to
set net = createobject('wscript.network")
UserDomain = net.UserDomain

or simply

UserDomain = createobject('wscript.network").UserDomain

Assumes Windows Script Host is installed...

--
Michael Harris


Nicolas Quentin (France) <nico...@hotmail.com> wrote in message
news:377CD2...@hotmail.com...

swhi...@jackson.k12.ms.us

unread,
Jul 7, 1999, 3:00:00 AM7/7/99
to
This never has worked for me - I have ADSI installed with WSH 2.0 Beta
2 on a Win98 First Edition machine logging into an NT 4.0 SP4 Domain.
I have tried it without ADSi, on WSH 1.0, etc and cannot ever return
the Doman Name.

Any ideas?

In article <ep7F7Z8x#GA....@cppssbbsa02.microsoft.com>,


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

Michael Harris

unread,
Jul 7, 1999, 3:00:00 AM7/7/99
to
If you use this from a logon script, you need to set an error trap and loop
until the username/domain is non-blank. It's a documented "gotcha" because
on Win9x, the logon script starts executing before the user is fully logged
on.

--
Michael Harris


<swhi...@jackson.k12.ms.us> wrote in message
news:7lvnki$dq9$1...@nnrp1.deja.com...

Manfred Braun

unread,
Jul 8, 1999, 3:00:00 AM7/8/99
to
Hi,

I know that problem with W95. In my case, there was no
otherwise posted solution. We read the following restriy key
instead:

HKEY_LOCAL_MACHINE\SECURITY\PROVIDER\CONTAINER

Hope this helps.

Best regards,
Manfred Braun

(Private)
Lange Roetterstrasse 7
D68167 Mannheim
Germany

mailto:_mbr...@manfred.mannheim-netz.de
(Remove the anti-spam-underscore to mail me!)

0 new messages