Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Demote from one and Join Another 1

Status
Not open for further replies.

SerialCoder

Programmer
Oct 18, 2002
95
US
I have a new domain set up on a new system on my bench. I want to demote one of my old servers from the old domain and then join it to the new domain. If I do this will the files on the old server drop their permissions? That is fine if that is the case, i just dont want to run into issues where I cant get to them.

Is this a simple proceedure?

David Tulk
IS Manager - Dillin Engineered Systems
Conveyor Systems - Accumulation - Robotics - Systems Integration
 
You say you wish to demote the server. Do you mean demote in the sense of removing AD or are you referring to disjoining from a domain and joining another?

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
 
It is currently a member server of one domain. I wish to dis-join that domain and move it to a new domain.

David Tulk
IS Manager - Dillin Engineered Systems
Conveyor Systems - Accumulation - Robotics - Systems Integration
 
Code:
'==========================================================================
'
' NAME: NetDomJoinWorkstations
'
' AUTHOR: Mark D. MacLachlan , The Spider's Parlor
' URL: [URL unfurl="true"]http://www.thespidersparlor.com[/URL]
' DATE  : 6/24/2003
'
' COMMENT: Joins computers to a new domain.  Edit domain name, 
' user ID and passwords below.  Uses a workstation list wslist.txt. 
' Modification 7/28/2003 to include Remove command.  Suggest synchronizing old and new server passwords 
'
'
'    THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
'    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED To
'    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
'    PARTICULAR PURPOSE.
'
'    IN NO EVENT SHALL THE SPIDER'S PARLOR AND/OR ITS RESPECTIVE SUPPLIERS 
'    BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
'    DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
'    WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
'    ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
'    OF THIS CODE OR INFORMATION.
'==========================================================================

On Error Resume Next

'open the file system object
Set oFSO = CreateObject("Scripting.FileSystemObject")
set WSHShell = wscript.createObject("wscript.shell")
'open the data file
Set oTextStream = oFSO.OpenTextFile("wslist.txt")
'make an array from the data file
RemotePC = Split(oTextStream.ReadAll, vbNewLine)
'close the data file
oTextStream.Close

For Each strWorkstation In RemotePC
'Do something useful with strWorkstation
Call WSHShell.Run("cmd.exe /c NETDOM REMOVE " & strWorkstation &"/Domain:<domain> /UserD:<user> /PasswordD:<password> UserO:<user> /PasswordO:<password> /REBoot:30000")
Wscript.sleep 15000
Call WSHShell.Run("cmd.exe /c NETDOM JOIN " & strWorkstation &"/Domain:<domain> /UserD:<user> /PasswordD:<password> UserO:<user> /PasswordO:<password> /REBoot:0")

Next

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
 
Markdmac,
For starters you should be posting an VBScript solution in the VBScript forum and not Windows 2000 forum. forum329

Just kidding...
 
rofl.gif


I see you have been reading the rash of posts in the wrong forum lately WhoKilledKenny.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top