Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 418
  • Last Modified:

Powershell 2 Scripts for Windows XP

I have created a powershell 3.0 script on my windows 2008 R2 domain controller to remove and add clients to the domain remotely. However this does not work on Windows XP as it only supports Powershell 2.0, I am aware of how to run PS 2.0 on my Server 2008 R2 DC however I cannot find the commands to remotely remove and add windows XP clients to and from the domain. Can someone please help me with this?
0
Sbsystems
Asked:
Sbsystems
  • 2
  • 2
1 Solution
 
Joe KlimisCommented:
Hi

You will need to use the netdom.exe utility which can be found in by

Install the Remote Server Administration Tools (RSAT).
Go to Control Panel -> Programs and Features -> Turn Windows features on or off
In the treeview, go to Remote Server Administration Tools -> Role Administration Tools -> AD DS and AD LDS Tools and select AD DS Tools. Click OK.


The following show the syntax to rename a computer , add computer to the domain , and
then reboot the computer

I hope this help

## rename a computer 
netdom renamecomputer MycomputerOld /newname:MycomputerNew.mydomain.com /userd:administrator

## add computer to domain
 NETDOM /Domain:MYDOMAIN /user:administrator /password:apassword MEMBER
      MYCOMPUTER /JOINDOMAIN

## reboot the computer
shutdown /r /m Mycomputer

Open in new window

0
 
SbsystemsAuthor Commented:
Ok, thanks I have already done this before. So it is not possible to do this via PowerShell in XP?
0
 
Joe KlimisCommented:
The add-computer is the command-let that was to replace netdom.exe

You can run netdom command from a PowerShell script though and also the netdom command does not need to be run on the XP machine , it can be done remotely ,

the same as the add-computer command can be run remotely to add a machine to a domain

I hope this helps

Joe
0
 
SbsystemsAuthor Commented:
Thanks Joe
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now