{"id":125,"date":"2020-05-05T13:37:30","date_gmt":"2020-05-05T13:37:30","guid":{"rendered":"https:\/\/www.tsfactory.com\/forums\/blogs\/?p=125"},"modified":"2021-01-28T13:51:18","modified_gmt":"2021-01-28T13:51:18","slug":"listing-the-full-windows-machine-name-including-domain","status":"publish","type":"post","link":"https:\/\/www.tsfactory.com\/forums\/blogs\/listing-the-full-windows-machine-name-including-domain\/","title":{"rendered":"Listing the full Windows machine name including domain"},"content":{"rendered":"<p>I was searching the other day for a way to print out the fully qualified domain name of a machine I was working on and finally found this solution:<\/p>\n<p>C:\\&gt; echo %COMPUTERNAME%.%USERDNSDOMAIN%<\/p>\n<p>which returns:<\/p>\n<p>SMGR.TSFACTORY.COM<\/p>\n<p>for that machine. Wonderful.<\/p>\n<p>This may fail however if your users are in a different domain than the machine. %USERDNSDOMAIN% will return the user&#8217;s domain, not the machine&#8217;s domain. This command will return the correct answer in this case:<\/p>\n<pre><code>C:\\&gt; FOR \/F \"tokens=2\" %i in ('systeminfo ^| find \/i \"Domain\"') do echo %computername%.%i<\/code><\/pre>\n<p>Note:\u00a0 use double <code>%<\/code>\u00a0for\u00a0<code>%i<\/code>\u00a0if using this in a batchfile. e.g.\u00a0<code>%%i<\/code><\/p>\n<p>There are other methods that don&#8217;t use systeminfo (which slows down the process), but they are more than one line commands. You can google search to find more robust alternative batch code samples.<\/p>\n<p>I know this info is available via other screens, but I needed it via dos command line for a bit of testing and programming I was doing at the time. Hey, works for me.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was searching the other day for a way to print out the fully qualified domain name of a machine I was working on and finally found this solution: C:\\&gt; echo %COMPUTERNAME%.%USERDNSDOMAIN% which returns: SMGR.TSFACTORY.COM for that machine. Wonderful. This may fail however if your users are in a different domain than the machine. %USERDNSDOMAIN% [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":98,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[25],"class_list":["post-125","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-everythingrdp","tag-widows-machine"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Listing the full Windows machine name including domain - Blogs<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.tsfactory.com\/forums\/blogs\/listing-the-full-windows-machine-name-including-domain\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Listing the full Windows machine name including domain - Blogs\" \/>\n<meta property=\"og:description\" content=\"I was searching the other day for a way to print out the fully qualified domain name of a machine I was working on and finally found this solution: C:&gt; echo %COMPUTERNAME%.%USERDNSDOMAIN% which returns: SMGR.TSFACTORY.COM for that machine. Wonderful. This may fail however if your users are in a different domain than the machine. %USERDNSDOMAIN% [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.tsfactory.com\/forums\/blogs\/listing-the-full-windows-machine-name-including-domain\/\" \/>\n<meta property=\"og:site_name\" content=\"Blogs\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/TSFactoryLLC\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-05-05T13:37:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-01-28T13:51:18+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.tsfactory.com\/forums\/blogs\/wp-content\/uploads\/sites\/16\/2020\/06\/woman-standing-while-carrying-laptop-1181354.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"854\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Thomas Kucmierz\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@TSFactoryLLC\" \/>\n<meta name=\"twitter:site\" content=\"@TSFactoryLLC\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Thomas Kucmierz\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.tsfactory.com\/forums\/blogs\/listing-the-full-windows-machine-name-including-domain\/\",\"url\":\"https:\/\/www.tsfactory.com\/forums\/blogs\/listing-the-full-windows-machine-name-including-domain\/\",\"name\":\"Listing the full Windows machine name including domain - Blogs\",\"isPartOf\":{\"@id\":\"https:\/\/www.tsfactory.com\/forums\/blogs\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.tsfactory.com\/forums\/blogs\/listing-the-full-windows-machine-name-including-domain\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.tsfactory.com\/forums\/blogs\/listing-the-full-windows-machine-name-including-domain\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.tsfactory.com\/forums\/blogs\/wp-content\/uploads\/sites\/16\/2020\/06\/woman-standing-while-carrying-laptop-1181354.jpg\",\"datePublished\":\"2020-05-05T13:37:30+00:00\",\"dateModified\":\"2021-01-28T13:51:18+00:00\",\"author\":{\"@id\":\"https:\/\/www.tsfactory.com\/forums\/blogs\/#\/schema\/person\/8e7f4d55c90bbfa9db13a8a349afcbec\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.tsfactory.com\/forums\/blogs\/listing-the-full-windows-machine-name-including-domain\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.tsfactory.com\/forums\/blogs\/listing-the-full-windows-machine-name-including-domain\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.tsfactory.com\/forums\/blogs\/listing-the-full-windows-machine-name-including-domain\/#primaryimage\",\"url\":\"https:\/\/www.tsfactory.com\/forums\/blogs\/wp-content\/uploads\/sites\/16\/2020\/06\/woman-standing-while-carrying-laptop-1181354.jpg\",\"contentUrl\":\"https:\/\/www.tsfactory.com\/forums\/blogs\/wp-content\/uploads\/sites\/16\/2020\/06\/woman-standing-while-carrying-laptop-1181354.jpg\",\"width\":1280,\"height\":854},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.tsfactory.com\/forums\/blogs\/listing-the-full-windows-machine-name-including-domain\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.tsfactory.com\/forums\/blogs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Listing the full Windows machine name including domain\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.tsfactory.com\/forums\/blogs\/#website\",\"url\":\"https:\/\/www.tsfactory.com\/forums\/blogs\/\",\"name\":\"Blogs\",\"description\":\"TSFactory\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.tsfactory.com\/forums\/blogs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.tsfactory.com\/forums\/blogs\/#\/schema\/person\/8e7f4d55c90bbfa9db13a8a349afcbec\",\"name\":\"Thomas Kucmierz\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.tsfactory.com\/forums\/blogs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/523758d74448ec724d30b7888a7707b22e7815470076d5913e0403095e38419e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/523758d74448ec724d30b7888a7707b22e7815470076d5913e0403095e38419e?s=96&d=mm&r=g\",\"caption\":\"Thomas Kucmierz\"},\"url\":\"https:\/\/www.tsfactory.com\/forums\/blogs\/author\/tom\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Listing the full Windows machine name including domain - Blogs","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.tsfactory.com\/forums\/blogs\/listing-the-full-windows-machine-name-including-domain\/","og_locale":"en_US","og_type":"article","og_title":"Listing the full Windows machine name including domain - Blogs","og_description":"I was searching the other day for a way to print out the fully qualified domain name of a machine I was working on and finally found this solution: C:&gt; echo %COMPUTERNAME%.%USERDNSDOMAIN% which returns: SMGR.TSFACTORY.COM for that machine. Wonderful. This may fail however if your users are in a different domain than the machine. %USERDNSDOMAIN% [&hellip;]","og_url":"https:\/\/www.tsfactory.com\/forums\/blogs\/listing-the-full-windows-machine-name-including-domain\/","og_site_name":"Blogs","article_publisher":"https:\/\/www.facebook.com\/TSFactoryLLC\/","article_published_time":"2020-05-05T13:37:30+00:00","article_modified_time":"2021-01-28T13:51:18+00:00","og_image":[{"width":1280,"height":854,"url":"https:\/\/www.tsfactory.com\/forums\/blogs\/wp-content\/uploads\/sites\/16\/2020\/06\/woman-standing-while-carrying-laptop-1181354.jpg","type":"image\/jpeg"}],"author":"Thomas Kucmierz","twitter_card":"summary_large_image","twitter_creator":"@TSFactoryLLC","twitter_site":"@TSFactoryLLC","twitter_misc":{"Written by":"Thomas Kucmierz","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.tsfactory.com\/forums\/blogs\/listing-the-full-windows-machine-name-including-domain\/","url":"https:\/\/www.tsfactory.com\/forums\/blogs\/listing-the-full-windows-machine-name-including-domain\/","name":"Listing the full Windows machine name including domain - Blogs","isPartOf":{"@id":"https:\/\/www.tsfactory.com\/forums\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.tsfactory.com\/forums\/blogs\/listing-the-full-windows-machine-name-including-domain\/#primaryimage"},"image":{"@id":"https:\/\/www.tsfactory.com\/forums\/blogs\/listing-the-full-windows-machine-name-including-domain\/#primaryimage"},"thumbnailUrl":"https:\/\/www.tsfactory.com\/forums\/blogs\/wp-content\/uploads\/sites\/16\/2020\/06\/woman-standing-while-carrying-laptop-1181354.jpg","datePublished":"2020-05-05T13:37:30+00:00","dateModified":"2021-01-28T13:51:18+00:00","author":{"@id":"https:\/\/www.tsfactory.com\/forums\/blogs\/#\/schema\/person\/8e7f4d55c90bbfa9db13a8a349afcbec"},"breadcrumb":{"@id":"https:\/\/www.tsfactory.com\/forums\/blogs\/listing-the-full-windows-machine-name-including-domain\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.tsfactory.com\/forums\/blogs\/listing-the-full-windows-machine-name-including-domain\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.tsfactory.com\/forums\/blogs\/listing-the-full-windows-machine-name-including-domain\/#primaryimage","url":"https:\/\/www.tsfactory.com\/forums\/blogs\/wp-content\/uploads\/sites\/16\/2020\/06\/woman-standing-while-carrying-laptop-1181354.jpg","contentUrl":"https:\/\/www.tsfactory.com\/forums\/blogs\/wp-content\/uploads\/sites\/16\/2020\/06\/woman-standing-while-carrying-laptop-1181354.jpg","width":1280,"height":854},{"@type":"BreadcrumbList","@id":"https:\/\/www.tsfactory.com\/forums\/blogs\/listing-the-full-windows-machine-name-including-domain\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.tsfactory.com\/forums\/blogs\/"},{"@type":"ListItem","position":2,"name":"Listing the full Windows machine name including domain"}]},{"@type":"WebSite","@id":"https:\/\/www.tsfactory.com\/forums\/blogs\/#website","url":"https:\/\/www.tsfactory.com\/forums\/blogs\/","name":"Blogs","description":"TSFactory","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.tsfactory.com\/forums\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.tsfactory.com\/forums\/blogs\/#\/schema\/person\/8e7f4d55c90bbfa9db13a8a349afcbec","name":"Thomas Kucmierz","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.tsfactory.com\/forums\/blogs\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/523758d74448ec724d30b7888a7707b22e7815470076d5913e0403095e38419e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/523758d74448ec724d30b7888a7707b22e7815470076d5913e0403095e38419e?s=96&d=mm&r=g","caption":"Thomas Kucmierz"},"url":"https:\/\/www.tsfactory.com\/forums\/blogs\/author\/tom\/"}]}},"_links":{"self":[{"href":"https:\/\/www.tsfactory.com\/forums\/blogs\/wp-json\/wp\/v2\/posts\/125","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tsfactory.com\/forums\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tsfactory.com\/forums\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tsfactory.com\/forums\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tsfactory.com\/forums\/blogs\/wp-json\/wp\/v2\/comments?post=125"}],"version-history":[{"count":1,"href":"https:\/\/www.tsfactory.com\/forums\/blogs\/wp-json\/wp\/v2\/posts\/125\/revisions"}],"predecessor-version":[{"id":127,"href":"https:\/\/www.tsfactory.com\/forums\/blogs\/wp-json\/wp\/v2\/posts\/125\/revisions\/127"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.tsfactory.com\/forums\/blogs\/wp-json\/wp\/v2\/media\/98"}],"wp:attachment":[{"href":"https:\/\/www.tsfactory.com\/forums\/blogs\/wp-json\/wp\/v2\/media?parent=125"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tsfactory.com\/forums\/blogs\/wp-json\/wp\/v2\/categories?post=125"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tsfactory.com\/forums\/blogs\/wp-json\/wp\/v2\/tags?post=125"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}