Avatar of Dwight Baer
Dwight Baer
Flag for Canada asked on

"Remove-Computer" or "Remove-ADComputer" - which is best?

I'm using Windows Server 2012 R2 - trying to remove a computer from a domain using PowerShell.

Which command is best, and how are the results different?
1.  Remove-ADComputer -Identity "Server01"
(See https://technet.microsoft.com/en-us/library/ee617250.aspx )

OR

2.  Remove-Computer -Computername Server01 -UnjoinCredential domainname\administrator -Passthru -Verbose -Force -Restart
(See https://technet.microsoft.com/en-us/library/hh849816(v=wps.620).aspx  )

Thanks a lot.
Active DirectoryWindows Server 2012Powershell

Avatar of undefined
Last Comment
Dwight Baer

8/22/2022 - Mon
SOLUTION
Cotillion

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
SOLUTION
Sekar Chinnakannu

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Dwight Baer

ASKER
Ah ... Remove-ADComputer is more mulit-purpose.  OK.
Dwight Baer

ASKER
Thanks, both.
ASKER CERTIFIED SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Dwight Baer

ASKER
Sorry, the "supplementary question" was a bit of an afterthought, I didn't actually mean to close the question!  Thanks very much for your answer, footech.  Sorry about the points.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
jmcg

The "Request attention" button found at the bottom of the question block will notify an admin. Just explain in the box what you would like done. In a case like this, the question can be reopened.
Dwight Baer

ASKER
Thanks again.  I thought I had closed this.