script to join domain

Discussion in 'Scripting' started by mike zedalis, Jul 28, 2003.

  1. mike zedalis

    mike zedalis Guest

    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)
     
    mike zedalis, Jul 28, 2003
    #1
    1. Advertising

  2. mike zedalis

    Yoann Roman Guest

    > [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.
     
    Yoann Roman, Jul 29, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mjerikboo777

    vbs script to join domain error

    mjerikboo777, Feb 15, 2005, in forum: Windows Server
    Replies:
    0
    Views:
    429
    mjerikboo777
    Feb 15, 2005
  2. Faisal Zia

    Join PC's to Domain via Script

    Faisal Zia, Sep 29, 2008, in forum: Active Directory
    Replies:
    8
    Views:
    1,832
    Meinolf Weber [MVP-DS]
    Mar 27, 2009
  3. Richard Mueller [MVP]

    Re: AD script to join domain

    Richard Mueller [MVP], Mar 10, 2009, in forum: Active Directory
    Replies:
    0
    Views:
    367
    Richard Mueller [MVP]
    Mar 10, 2009
  4. Newbie
    Replies:
    6
    Views:
    644
    Ace Fekay [Microsoft Certified Trainer]
    Mar 18, 2009
  5. Kelly
    Replies:
    0
    Views:
    559
    Kelly
    Feb 1, 2006
Loading...

Share This Page