Jump to content

Recommended Posts

Posted

Hi, I have been using the following VB script to add computers to the domain for some time now. Suddenly on our dell 9020s it has stopped working, it says domain joined as though it has reached the end of the script without issue but it hasn't actually worked. It works on all other machine still fine and nothing to my knowledge has changed on the Dell. It's a mystery. If anyone could give me any insight it would be much appreciated. Thanks

 

Const JOIN_DOMAIN = 1Const 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 = "network"

strUser = "username"

strPassword = "password"

 

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)

 

 

MsgBox "Finished Domain change!", vbSystemModal+vbInformation

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...