{"id":5138,"date":"2018-01-10T22:25:41","date_gmt":"2018-01-10T21:25:41","guid":{"rendered":"https:\/\/michlstechblog.info\/blog\/?p=5138"},"modified":"2018-01-11T10:49:46","modified_gmt":"2018-01-11T09:49:46","slug":"windows-join-a-workgroup-or-domain-from-command-line","status":"publish","type":"post","link":"https:\/\/michlstechblog.info\/blog\/windows-join-a-workgroup-or-domain-from-command-line\/","title":{"rendered":"Windows: Join a workgroup or domain from command line"},"content":{"rendered":"<div class=\"twoclick_social_bookmarks_post_5138 social_share_privacy clearfix 1.6.4 locale-en_US sprite-en_US\"><\/div><div class=\"twoclick-js\"><script type=\"text\/javascript\">\/* <![CDATA[ *\/\njQuery(document).ready(function($){if($('.twoclick_social_bookmarks_post_5138')){$('.twoclick_social_bookmarks_post_5138').socialSharePrivacy({\"services\":{\"flattr\":{\"uid\":\"Michl\",\"status\":\"on\",\"the_title\":\"Windows%3A%20Join%20a%20workgroup%20or%20domain%20from%20command%20line\",\"the_excerpt\":\"Hi%2C%0D%0A%0D%0Athere%20are%20two%20ways%20to%20join%20or%20leave%20a%20domain.%20The%20netdom%20command%20or%20the%20Powershell%20Command%20lets%20add-computer%20and%20remove-computer.%0D%0A%20%28more%26hellip%3B%29\",\"txt_info\":\"2 clicks for more data protection:\\r\\n\\r\\nOnly when you click here, the button will be come active and you can send your recommendation to Flattr. When activating, data are transmitted to third parties. \",\"perma_option\":\"off\"}},\"txt_help\":\"When you activate these fields by clicking, information to Flattr may be transferred abroad, and probably may also stored there.\",\"settings_perma\":\"Enable permanently and accept data transmission. \",\"info_link\":\"http:\\\/\\\/www.heise.de\\\/ct\\\/artikel\\\/2-Klicks-fuer-mehr-Datenschutz-1333879.html\",\"uri\":\"https:\\\/\\\/michlstechblog.info\\\/blog\\\/windows-join-a-workgroup-or-domain-from-command-line\\\/\",\"post_id\":5138,\"post_title_referrer_track\":\"Windows%3A+Join+a+workgroup+or+domain+from+command+line\",\"display_infobox\":\"on\"});}});\n\/* ]]> *\/<\/script><\/div><p>Hi,<\/p>\n<p>there are two ways to join or leave a domain. The netdom command or the Powershell Command lets add-computer and remove-computer.<br \/>\n<!--more--><br \/>\nThe netdom way<\/p>\n<p>Join a domain. If you are logged on at the machine you want to join<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nC:\\&gt; netdom join %computername% \/domain:your.ADDomainToJoin.net \/UserD:LoginWithJoinPermissions \/PasswordD:*\r\n<\/pre>\n<p>Remove from Domain and join a workgroup. The \/force option disjoins the computer from the domain even if you to not have the permission to remove the computer object from the domain. The domain computer object remains.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nc:\\&gt; netdom remove %computername% \/domain:your.OldADDomain.net \/force\r\n<\/pre>\n<p>The Powershell way<\/p>\n<p><a href=\"https:\/\/docs.microsoft.com\/de-de\/powershell\/module\/Microsoft.PowerShell.Management\/Add-Computer\" rel=\"noopener\" target=\"_blank\">Join <\/a>a Domain<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\r\nPS C:\\&gt; Add-computer -DomainName &quot;your.ADDomainToJoin.net&quot; -Credential LoginWithJoinPermissions \r\n<\/pre>\n<p><a href=\"https:\/\/docs.microsoft.com\/de-de\/powershell\/module\/Microsoft.PowerShell.Management\/Remove-Computer\" rel=\"noopener\" target=\"_blank\">Remove <\/a>from Domain and join a workgroup. <\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\r\nPS C:\\&gt; Remove-computer -WorkgroupName yourWorkgroup \r\n<\/pre>\n<p>Michael<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi, there are two ways to join or leave a domain. The netdom command or the Powershell Command lets add-computer and remove-computer.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[1137,1133,126,1135,127,1136,1138,20,1134],"class_list":["post-5138","post","type-post","status-publish","format-standard","hentry","category-windowsknowhow","tag-add-computer","tag-disjoin","tag-domain","tag-force","tag-join","tag-netdom","tag-remove-computer","tag-windows-2","tag-workgroup"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/5138","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/comments?post=5138"}],"version-history":[{"count":5,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/5138\/revisions"}],"predecessor-version":[{"id":5144,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/5138\/revisions\/5144"}],"wp:attachment":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/media?parent=5138"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/categories?post=5138"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/tags?post=5138"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}