![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to Remove the computer from the AD domain using PowerShell?
To remove the computer from the domain we need to use the Remove-Computer command.
Remove-Computer -ComputerName Test1-win2k16 ` -UnjoinDomainCredential Labdomain\Administrator ` -WorkgroupName WG -Restart -Force -PassThru
In the above example, the Computer name Test1-Win2k16 is going to remove from the domain with the domain credentials and it will be joined to WorkGroup named WG. If the system doesn’t restart due to any reason, you need to reboot the system manually.
Here the computer name is the String[]. So you can provide multiple computers to remove from the domain. For example,
Remove-Computer -ComputerName Test1-win2k16, Test1-Win2k12 ` -UnjoinDomainCredential Labdomain\Administrator ` -WorkgroupName WG -Restart -Force -PassThru
Advertisements