0% found this document useful (0 votes)
7 views

Add Computers to a Domain with PowerShell

Uploaded by

Pei Cheng Wu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Add Computers to a Domain with PowerShell

Uploaded by

Pei Cheng Wu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

1/8/25, 2:43 PM Add Computers to a Domain with PowerShell

MFA Misconceptions: Building a Truly


Zero Trust and Enterprise Data Backup
Robust Authentication Process
Learn more about Zero Trust and how it applies
Organizations must constantly re-evaluate and
to backup & recovery infrastructure, Zero Trust
reinforce their cybersecurity strategies,
Data Resilience principles & architecture.
ensuring that every aspect, including MFA, is a…

How to Add Computers to a Domain Using PowerShell


Last Update: Sep 04, 2024 | Published: May 15, 2014
Blog / PowerShell / Post

SHARE ARTICLE
by Russell Smith
Sometimes it can useful to add a computer to a domain Table of Last Update: Sep 04, 2024
using the command line, such as when no GUI is available (as May 15, 2014
contents
is the case with Server Core), or just to expedite the process
Table of Russell Smith, the Editorial Director at Petri IT
when configuring multiple computers. In this easy Ask the
contents
Admin, I’ll show you how to add one or more Windows 8.1 Knowledgebase, has over two decades of hands-on
and Windows Server 2012 R2 PCs to a domain using experience in IT, in both small business settings and
Performing a
PowerShell. government IT infrastructure projects. Russell started
Domain Joi…
writing for Windows IT Pro Magazine in t...
The instructions in this article assume that DNS resolution is
Join Multiple
working correctly, i.e. you can resolve the domain name of
PCs to a…
the Active Directory domain you want to join, and that you
have connectivity to a domain controller (DC). RELATED ARTICLES

Advertisement
Mastering the PowerShell Trim Method
Nov 13, 2024 Nov 18, 2024
Performing a Domain Join
Using PowerShell How to Add Comments to Your PowerShell Code
and Scripts
Once you’ve established correct DNS resolution for the
domain name, start a PowerShell prompt with local Jul 15, 2024 Nov 19, 2024
administrative privileges.

Press the Windows key to switch to the Start menu, type


PowerShell and press CTRL+SHIFT+ENTER. If prompted, Take our survey
enter a local administrator username and password, or
give consent to run PowerShell. When it comes to adopting artificial intelligence (AI) in your
organization, which challenges do you face?
In the PowerShell prompt, type add-computer –
domainname ad.contoso.com -Credential Lack of understanding
ADadminuser -restart –force and press Enter. Enter a Data quality and availability
password for the domain administrator account when
Cost and budget constraints
prompted.
Security and privacy concerns

The PC should now restart and be joined to the domain once


it has restarted. Is your organization currently implementing AI solutions? If so,
what products or platforms are you utilizing?

Microsoft Copilot

Google Gemini
Add a computer to a domain using PowerShell.
IBM Watson

Join Multiple PCs to a Domain OpenAI

Other
You can add more than one computer to the domain, either
by using names from a text file or listing them in the

https://petri.com/add-computer-to-domain-powershell/ 1/2
1/8/25, 2:43 PM Add Computers to a Domain with PowerShell
command line as a comma-delimited list. You can use the – Submit View results
computername parameter even if PowerShell Remoting isn’t
enabled on the computers listed in the command line.

In a PowerShell command prompt, type add-computer -


computername srvcore01, srvcore02 -domainname Advertisement

ad.contoso.com –credential ADadminuser -restart – PETRI NEWSLETTERS


force and press Enter.
Type a password for the domain administrator account
Join Petri Insider
when prompted.
Create a free account today to participate in forum
The command above adds srvcore01 and srvcore02 to conversations, comment on posts and more.
ad.contoso.com domain. The account used to run the
PowerShell prompt would need permission to connect and Email*
join both servers to the domain. You could also specify a list
of servers in a text file (servers.txt) as follows: [email protected] Submit

Advertisement
add-computer -computername (get-content servers.txt)
-domainname ad.contoso.com –credential ADadminuser
-restart –force

In the above command, servers.txt would need to be located


in the PowerShell working directory.

SHARE ARTICLE

https://petri.com/add-computer-to-domain-powershell/ 2/2

You might also like