Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Scripting > script to join domain

Reply
Thread Tools Display Modes

script to join domain

 
 
mike zedalis
Guest
Posts: n/a

 
      07-28-2003
I have this script that i got from microsoft script
center. It is supposed to join a client to the domain.
They claim it is designed for XP and 2000. When i run it
i get this error "Object dosent support this property or
method objComputer.JoinDomainOrWorkgroup". I am just
learning scripts and not sure what my problem is. Thanks.
Const JOIN_DOMAIN = 1
Const ACCT_CREATE = 2
Const ACCT_DELETE = 4
Const WIN9X_UPGRADE = 16
Const DOMAIN_JOIN_IF_JOINED = 32
Const JOIN_UNSECURE = 64
Const MACHINE_PASSWORD_PASSED = 128
Const DEFERRED_SPN_SET = 256
Const INSTALL_INVOCATION = 262144

strDomain = "FABRIKAM"
strPassword = "ls4k5ywA"
strUser = "shenalan"

Set objNetwork = CreateObject("WScript.Network")
strComputer = objNetwork.ComputerName

Set objComputer = GetObject("winmgmts:
{impersonationLevel=Impersonate}!\\" & _
strComputer & "\root\cimv2:Win32_ComputerSystem.Name='" &
_
strComputer & "'")

ReturnValue = objComputer.JoinDomainOrWorkGroup
(strDomain, _
strPassword, _
strDomain & "\" & strUser, _
NULL, _
JOIN_DOMAIN + ACCT_CREATE)


 
Reply With Quote
 
 
 
 
Yoann Roman
Guest
Posts: n/a

 
      07-28-2003
> [snip]

I can't help you with the error you're getting, but I sure hope that
this....

> strDomain = "FABRIKAM"
> strPassword = "ls4k5ywA"
> strUser = "shenalan"


.... isn't your password. If it is, I would highly recommend changing it
right about now.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Join PC's to Domain via Script Faisal Zia Active Directory 8 03-27-2009 07:04 AM
User dis-join from domain, how to re-join again Newbie Active Directory 6 03-18-2009 03:05 AM
Re: AD script to join domain Richard Mueller [MVP] Active Directory 0 03-10-2009 03:18 PM
un-join Nt domain and join Windows 2003 domain script Kelly Scripting 0 02-01-2006 01:19 PM
vbs script to join domain error mjerikboo777 Windows Server 0 02-15-2005 09:59 PM