Re: Help with Objet required
- From: "Richard Mueller [MVP]" <rlmueller-nospam@xxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 19 May 2008 11:09:06 -0500
"Juanjillo" <juanjillo_____NOSPAM___@xxxxxxxxx> wrote in message
news:mn.9c297d857f379589.56404@xxxxxxxxxxxx
Richard Mueller [MVP] comentaba el 19/05/2008:
Juanjillo wrote:
I have this script in example1.vbs:
Dim objshell, objnetwotk
Set objshell = WScript.CreateObject("Wscript.Shell")
Set objnetwork = WScript.CreateObject("Wscript.Network")
Dim vdom, vuser
Set vdom = objnetwork.UserDomain
Set vuser = objnetwork.UserName
wscript.echo "Welcome to the domain: " & vdom & ", " & vuser & "."
when i execute this command with csript example1.vbs y have this
response.
Object is requied [string: "Mydomainname"]
Don't use "set" when you assign values to the string variables. Use:
vdom = objnetwork.UserDomain
Set vuser = objnetwork.UserName
Only use "Set" to assign object references, like objNetwork.
--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
Thanks a lot
I´m newbie wit this :D
--
Agures
No problem. The "Set" keyword takes getting used to. To learn more about
scripting for administration of AD networks I recommend "Microsoft Windows
2000 Scripting Guide". I like the hard copy text, but it is also available
online at:
http://www.microsoft.com/technet/scriptcenter/guide/sagsas_overview.mspx?mfr=true
The first few chapters in Part 1 explain the basics of WSH, VBScript, ADSI,
etc. For example, the Set statement (and your error) are explained here:
http://www.microsoft.com/technet/scriptcenter/guide/sas_vbs_ebqs.mspx
You can also learn from the scripts in the Technet Script Center:
http://www.microsoft.com/technet/scriptcenter/scripts/default.mspx?mfr=true
--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--
.
- Follow-Ups:
- Re: Help with Objet required
- From: Juanjillo
- Re: Help with Objet required
- References:
- Help with Objet required
- From: Juanjillo
- Re: Help with Objet required
- From: Richard Mueller [MVP]
- Re: Help with Objet required
- From: Juanjillo
- Help with Objet required
- Prev by Date: Re: Help with Objet required
- Next by Date: Re: XCACLS /I Copy fails with Errormessage (Msg#4306)
- Previous by thread: Re: Help with Objet required
- Next by thread: Re: Help with Objet required
- Index(es):
Relevant Pages
|
Loading