
Having trouble obtaining domain name please help
OK I was kinda think along the same lines found that registry yesterday
searching for my domian name.
Aslo I found that buy using the Find Computer tool that if you search for
your localmachinename you can select properties and it tells everything
about you machine example, WorkGroup, Curent UserName, and Even the Current
Domain your logged into. I was wondering if there is a way to pull the
information from the Find tool App.Also this but I want it to be transparent
to the user. I have a function from a Bill James who wrote the function and
a Walter Zackery who helps test and tweek the code to detect what version of
windows was on a machine. Here is the function
Function WinVer
WinVer = Replace(Split(WScript.GetObject("about:blank")._
parentWindow.navigator.appVersion,";")(2),")","")
End Function
Im not clear on what the
{ Replace(Split(WScript.GetObject("about:blank"). }
does other than it creates an object and store the info in WinVer and that
it creates the object from the
{ _parentWindow.navigator.app }
and I guess it reads the Version field but not sure what
{ ,";")(2),","") }
exactly means
also not sure exactly how they came up with the
_parentWindow.navigator.app } (possiably
Visual Basic)and how to apply that
to the Find Computer app and pull the infomation. If you could give me some
insight or resources to reasearch this would be a great help
Quote:
> Also asked and answered in the ...scripting.wsh NG
> (BTW, for something like this, it's better to crosspost ;-)...
> Q188602 - INFO: UserDomain Method Does Not Work Under Win95 with WSH
> http://support.microsoft.com/support/kb/articles/Q188/6/02.ASP
> Q233976 - Cannot Retrieve UserName Property in Windows Script Host
> http://support.microsoft.com/support/kb/articles/Q233/9/76.ASP
> --
> Michael Harris
> MVP Scripting
Quote:
> Im sorry for not being more specific this
> '*******************************'
> Dim objNet
> Set objNet = WScript.CreateObject("WScript.Network")
> '*********************************************'
> mydomain = objNet.UserDomain
> WScript.Echo objNet.ComputerName & " - " & objNet.UserDomain
> MsgBox mydomain
> this script works on windows NT but not win9x it doesnt return a value . I
> was wondering is there is a
> work around for this and also if this is fixed in ver 5.5
> Also to answer the version 5.5 question it doesnt fix this.
> > It doesn't return ANYTHING? or just no domain?
> > > example
> > > Set objNet = WScript.CreateObject("WScript.Network")
> > > WScript.Echo objNet.ComputerName & " - " & objNet.UserDomain
> > > yeilds no results