Having trouble obtaining domain name please help 
Author Message
 Having trouble obtaining domain name please help

example
Set objNet = WScript.CreateObject("WScript.Network")
WScript.Echo objNet.ComputerName & " - " & objNet.UserDomain

yeilds no results



Mon, 30 Dec 2002 03:00:00 GMT  
 Having trouble obtaining domain name please help
It doesn't return ANYTHING? or just no domain?


Quote:
> example
> Set objNet = WScript.CreateObject("WScript.Network")
> WScript.Echo objNet.ComputerName & " - " & objNet.UserDomain

> yeilds no results



Mon, 30 Dec 2002 03:00:00 GMT  
 Having trouble obtaining domain name please help

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.


Quote:
> 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



Mon, 30 Dec 2002 03:00:00 GMT  
 Having trouble obtaining domain name please help

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

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.


Quote:
> 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



Mon, 30 Dec 2002 03:00:00 GMT  
 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




- Show quoted text -

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



Tue, 31 Dec 2002 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Im having trouble obtaining domian name. Please Help

2. Newbie Having trouble with this User Info script, Please help

3. Having Trouble with CurDir - Please Help

4. Please help! Having trouble with data control

5. PLEASE HELP!!! Having trouble with VB5 component

6. Obtaining domain name

7. GetObject for obtaining a domain-name ?!

8. Obtaining Domain name in a Logon script

9. please please help, Epson stylus Color IIs trouble

10. PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP,

11. Help: having trouble with IF statements and calculated fields

12. Having trouble connecting after closing and opening new form...Help

 

 
Powered by phpBB® Forum Software