How do I tell if account I'm running my script is domain account or local ?
I'm using vbscript.
thanks
Vilius
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
--
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 Directory Services
Hilltop Lab - http://www.rlmueller.net
--
"Vilius Mock�nas" <v_moc...@yahoo.com> wrote in message
news:OVCH%231GHK...@TK2MSFTNGP02.phx.gbl...
V
"Richard Mueller [MVP]" <rlmuelle...@ameritech.nospam.net> wrote in
message news:e9tKMZHH...@TK2MSFTNGP05.phx.gbl...
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...