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

Domain account or local ?

0 views
Skip to first unread message

Vilius Mock�nas

unread,
Aug 13, 2009, 5:24:12 PM8/13/09
to
Hi,

How do I tell if account I'm running my script is domain account or local ?
I'm using vbscript.

thanks
Vilius


Richard Mueller [MVP]

unread,
Aug 13, 2009, 6:29:12 PM8/13/09
to

"Vilius Mock�nas" <v_moc...@yahoo.com> wrote in message
news:e2osUxFH...@TK2MSFTNGP04.phx.gbl...

I code similar to the following:
=======
On Error Resume Next
Set objSysInfo = CreateObject("ADSystemInfo")
If (Err.Number = 0) Then
strUserDN = objSysInfo.UserName
If (Err.Number = 0) Then
On Error GoTo 0
blnDomain = True
Else
On Error GoTo 0
blnDomain = False
End If
Else
On Error GoTo 0
blnDomain = False
End If
========
If blnDomain is True, the user is authenticated to AD. There may be other
ways, but I chose this method because it times quickly if the user is not
authenticated to a domain. I'd be interested to know if anyone has other
methods.

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--


Vilius Mock�nas

unread,
Aug 13, 2009, 7:27:03 PM8/13/09
to
Hi,

Thanks for advice.
But I found simpler way:
dim o_wsh_network
set o_wsh_network = createobject( "WScript.Network" )
if o_wsh_network.userdomain = o_wsh_network.computername then
msgbox( "local account" )
else
msgbox( "domain account" )
endif

V

"Richard Mueller [MVP]" <rlmuelle...@ameritech.nospam.net> wrote in
message news:e6I19VGH...@TK2MSFTNGP02.phx.gbl...

Richard Mueller [MVP]

unread,
Aug 13, 2009, 8:29:30 PM8/13/09
to
You may need to test that in a workgroup situation.

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--

"Vilius Mock�nas" <v_moc...@yahoo.com> wrote in message

news:OVCH%231GHK...@TK2MSFTNGP02.phx.gbl...

Vilius Mock�nas

unread,
Aug 13, 2009, 8:42:05 PM8/13/09
to
As I remember userdomain property never returns workgroup name only
computer/domain.

V

"Richard Mueller [MVP]" <rlmuelle...@ameritech.nospam.net> wrote in

message news:e9tKMZHH...@TK2MSFTNGP05.phx.gbl...

Anthony Hollowell

unread,
Sep 14, 2009, 10:44:25 AM9/14/09
to
is my domain name free for the year?

"Vilius Mock�nas" <v_moc...@yahoo.com> wrote in message
news:e2osUxFH...@TK2MSFTNGP04.phx.gbl...

asdf

unread,
Dec 6, 2009, 4:07:48 AM12/6/09
to
Do not tsunami all groups with the same questions.

It is like doctors trying to operate all wounds at the same time after an
accident.

The body will refuse and cease to work.

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

The body of knowledge is precious here.

There is less gold in the world than posters as you. ( I am not an native
English speaker)

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


As to your interpretable intend.

You must nowadays be an 'admin' to tell the distinction

whether you can detect / overwrite credentials.

*credentials = see groups history keyword


"Anthony Hollowell" <A_Hol...@live.com> wrote in message
news:uCg6$lUNKH...@TK2MSFTNGP02.phx.gbl...

0 new messages