Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Scripting > Re: AD script to join domain

Reply
Thread Tools Display Modes

Re: AD script to join domain

 
 
Isaac Oben [MCITP,MCSE]
Guest
Posts: n/a

 
      03-10-2009
Hello RC, what error are you geeting. I am cross posting to scripting group
as well for addittional help

--
Isaac Oben [MCTIP:EA, MCSE]

"RC" <> wrote in message
news:9433a6fb-bd1d-49da-948a-...
>I am using this code from the AD Cookbook but I it doesnt seem to
> work. thoughts?
>
> 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 = "DOMAIN"
> strPassword = "PASSWORD"
> strUser = "USERNAME"
>
> Set objNetwork = CreateObject("WScript.Network")
> strComputer = objNetwork.ComputerName
>
> Set objComputer = GetObject("winmgmts:{impersonationLevel=Impersonat e}!
> \\" & _
> strComputer & "\root\cimv2:Win32_ComputerSystem.Name='" & _
> strComputer & "'")
>
> ReturnValue = objComputer.JoinDomainOrWorkGroup(strDomain, _
> strPassword, strDomain & "\" & strUser, NULL, _
> JOIN_DOMAIN + ACCT_CREATE)
>


 
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
Re: AD script to join domain Richard Mueller [MVP] Active Directory 0 03-10-2009 02:18 PM
WIN XP SP2 Join Domain Script Jam Scripting 2 03-13-2006 07:17 AM
un-join Nt domain and join Windows 2003 domain script Kelly Scripting 0 02-01-2006 12:19 PM
How to join domain by script? qq42935000 Scripting 6 03-04-2005 12:35 PM
script to join domain mike zedalis Scripting 1 07-28-2003 11:51 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59