Powershell 2 Scripts for Windows XP

Posted on 2014-03-10
Last Modified: 2014-03-26
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?
Question by:Sbsystems
  • 2
  • 2
LVL 10

Expert Comment

ID: 39920169

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 / /userd:administrator

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

## reboot the computer
shutdown /r /m Mycomputer

Open in new window


Author Comment

ID: 39922165
Ok, thanks I have already done this before. So it is not possible to do this via PowerShell in XP?
LVL 10

Accepted Solution

JoeKlimis earned 500 total points
ID: 39922289
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


Author Comment

ID: 39957983
Thanks Joe

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

This article shows how a content item can be identified directly or through translation of a navigation type. It then shows how this information can be used to create a menu for further navigation.
The article will show you how you can maintain a simple logfile of all Startup and Shutdown events on Windows servers and desktops with PowerShell. The script can be easily adapted into doing more like gracefully silencing/updating your monitoring s…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now