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. Advertisements

  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. Advertisements

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. mjerikboo777

    vbs script to join domain error

    mjerikboo777, Feb 15, 2005, in forum: Windows Server
    Replies:
    0
    Views:
    582
    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:
    2,107
    Meinolf Weber [MVP-DS]
    Mar 27, 2009
  3. Newbie
    Replies:
    6
    Views:
    1,066
    Ace Fekay [Microsoft Certified Trainer]
    Mar 18, 2009
  4. qq42935000

    How to join domain by script?

    qq42935000, Oct 4, 2004, in forum: Scripting
    Replies:
    6
    Views:
    1,154
  5. Kelly
    Replies:
    0
    Views:
    798
    Kelly
    Feb 1, 2006
  6. Jam

    WIN XP SP2 Join Domain Script

    Jam, Mar 10, 2006, in forum: Scripting
    Replies:
    2
    Views:
    952
  7. sc
    Replies:
    2
    Views:
    654
    Iberê Jones
    May 28, 2007
Loading...