Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


Move computer between containers

Keywords: 	 Move computer between containers 

Question:

I would like to move a computer account from one container to another via a winbatch script. Any help on how this is done would be appreciated!!

Answer:

Here is a snippet that should get you started.
if dsIsObject(Adsi_MyComputer_Target)
	Message(Title_Bar_Text,"%COMPUTERNAME% is already in the %Target% container.")
else
	if dsIsObject(Adsi_MyComputer_Computers)
		dsMoveObj(Adsi_MyComputer_Computers, Adsi_Target,"")
		Message(Title_Bar_Text,"%COMPUTERNAME% has been moved to the %Target% container.")
	else
		Message(Title_Bar_Text,"%COMPUTERNAME% is NOT in the Computers container.")
	EndIf ;Adsi_MyComputer_Computers
EndIf ;Adsi_MyComputer_Target