Re: From Workgroup to Domain
- From: max@xxxxxxx
- Date: 29 Nov 2006 05:34:03 -0800
Hi Gib
Thank you very much for that. - i will try that as soon as i can and
give you feedback..
/Max
Gibraltar skrev:
Hello Max,
Pls use the following code.
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)
Change the strdomain, user and password accordingly. The user should hv the
domain join priviliges.
Cheers,
Gib
"max@xxxxxxx" wrote:
Here´s the whole code as it is at the moment.
Set objWMIService = GetObject("winmgmts:
{impersonationlevel=impersonate}!\\<computername>\root\cimv2")
Const JOIN_DOMAIN = 1
set objComputer = objWMIService.Get("Win32_ComputerSystem.Name='" &
strCName & " ' ")
objComputer.JoinDomainOrWorkGroup strDomainName, strPassword, strNetDom
& "\" & strUser, NULL, JOIN_DOMAIN
m...@xxxxxxx skrev:
Hi Gib
it says: Line 1 letter 1 unspecefied error
:(
(I do a cscript "c:\yourscripthere.vbs" i command prompt)
/Max
Gibraltar skrev:
Please add this line to the code as a first line...
Set objWMIService = GetObject("winmgmts: {impersonationlevel=impersonate}!\\
<computername>\root\cimv2")
I am sorry I missed this out. Let me know if this doesn't work.
"max@xxxxxxx" wrote:
when i run the script I get an objet "objwmiservice" i necessary. when
i just raw copy paste your script :/ - what am i missing here to make
it work?
max@xxxxxxx skrev:
Hehe, i got some issuses with the script :( i just do a script
"test.vbs" at a prompt, and it gives me errors :( - But yearh just file
copying netdom.exe on to a win2k client doesen´t work :)
Gibraltar skrev:
Hi Max,
You can use these WMI lines in a VB Script
Const JOIN_DOMAIN = 1
set objComputer = objWMIService.Get("Win32_ComputerSystem.Name='" & strCName
& "'")
objComputer.JoinDomainOrWorkGroup strDomainName, strPassword, strNetDom &
"\" & strUser, NULL, JOIN_DOMAIN
where strCname is the Computer Name on which this script is running
strDomainName is the domain to which it has to join
strNetDom is the netbios name of the domain
strUser is the User that has priviliges to join a machine to the domain
strPassword is the password of the user.
Alternately as Jorge said you can use netdom utility but again you need copy
it to all the machines along with a supporting script.
Cheers,
Gib
"Jorge Silva" wrote:
Hi
do you like netdom?
http://technet2.microsoft.com/WindowsServer/en/library/539c5381-db4f-445f-aac0-2df5448181c11033.mspx?mfr=true
--
I hope that the information above helps you
Good Luck
Jorge Silva
MCSA
Systems Administrator
<max@xxxxxxx> wrote in message
news:1162821668.849920.290470@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi
Any chance you would have a demo or simply script done allready that
you can share? - would be cool, cos we could then try start to make the
first couple test on how that solution could work out, - and thank you
for the suggestion so far :)
Gibraltar skrev:
Hi Max,
Create a vbscript that joins a machine to domain. Using psexec tools,
copy
and execute them on all the machines to join them to the domain.
Hope this helps,
Gib
"max@xxxxxxx" wrote:
Hello,
I need a way, How i can centraly or via. a batch job change a clients
machine from a standard local workgroup, to being a member of my
domain.
Regardz:
Googler
.
- Prev by Date: Re: Reorranging a Domain Name Space
- Next by Date: Re: Tool for Creating Users
- Previous by thread: Software restriction policy - limit
- Next by thread: Re: From Workgroup to Domain
- Index(es):
Relevant Pages
|