Link to home
Start Free TrialLog in
Avatar of Dwight Baer
Dwight BaerFlag 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.
SOLUTION
Avatar of Cotillion
Cotillion
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Sekar Chinnakannu
Sekar Chinnakannu
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Dwight Baer

ASKER

Ah ... Remove-ADComputer is more mulit-purpose.  OK.
Thanks, both.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
Thanks again.  I thought I had closed this.