{"id":140,"date":"2008-05-06T12:00:00","date_gmt":"2008-05-06T16:00:00","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/2008\/05\/06\/more-cli-one-liners\/"},"modified":"2013-07-02T08:13:59","modified_gmt":"2013-07-02T12:13:59","slug":"more-cli-one-liners","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/140\/more-cli-one-liners\/","title":{"rendered":"More CLI One-Liners"},"content":{"rendered":"<p>In the past I've posted a collection of command one-liners that get a ton of work done with (relatively) minimal effort. Many of these have come from Wayne Martin. I've been behind in my blogging while book writing, but I wanted to make sure you checked out his latest list at:<\/p>\n<p><a title=\"http:\/\/waynes-world-it.blogspot.com\/2008\/04\/useful-command-lines.html\" href=\"http:\/\/waynes-world-it.blogspot.com\/2008\/04\/useful-command-lines.html\">http:\/\/waynes-world-it.blogspot.com\/2008\/04\/useful-command-lines.html<\/a><\/p>\n<div class=\"wlWriterSmartContent\" id=\"scid:0767317B-992E-4b12-91E0-4F059A8CECA8:a8c1eefc-564e-4944-87a2-835e2fb795cd\" style=\"margin: 0px; padding: 0px; display: inline;\"><span style=\"font-size:85%;\">Technorati Tags: <a href=\"http:\/\/technorati.com\/tags\/Automation\" rel=\"tag\">Automation<\/a>, <a href=\"http:\/\/technorati.com\/tags\/CLI\" rel=\"tag\">CLI<\/a>, FSMO, <a href=\"http:\/\/technorati.com\/tags\/batch\" rel=\"tag\">batch<\/a>, DSquery, <a href=\"http:\/\/technorati.com\/tags\/netsh\" rel=\"tag\">netsh<\/a>, <a href=\"http:\/\/technorati.com\/tags\/DHCP\" rel=\"tag\">DHCP<\/a>, <a href=\"http:\/\/technorati.com\/tags\/DNS\" rel=\"tag\">DNS<\/a>, <a href=\"http:\/\/technorati.com\/tags\/Active%20Directory\" rel=\"tag\">Active Directory<\/a><\/span><\/div>\n","protected":false},"excerpt":{"rendered":"<p>In the past I&#8217;ve posted a collection of command one-liners that get a ton of work done with (relatively) minimal effort. Many of these have come from Wayne Martin. I&#8217;ve been behind in my blogging while book writing, but I wanted to make sure you checked out his latest list at: http:\/\/waynes-world-it.blogspot.com\/2008\/04\/useful-command-lines.html Technorati Tags: Automation,&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4],"tags":[539,22,43,20,58,56,57,59],"class_list":["post-140","post","type-post","status-publish","format-standard","hentry","category-powershell","tag-active-directory","tag-automation","tag-batchfiles","tag-cli","tag-dhcp","tag-dns","tag-dsquery","tag-netsh"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>More CLI One-Liners &#8226; The Lonely Administrator<\/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:\/\/jdhitsolutions.com\/blog\/powershell\/140\/more-cli-one-liners\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"More CLI One-Liners &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"In the past I&#039;ve posted a collection of command one-liners that get a ton of work done with (relatively) minimal effort. Many of these have come from Wayne Martin. I&#039;ve been behind in my blogging while book writing, but I wanted to make sure you checked out his latest list at: http:\/\/waynes-world-it.blogspot.com\/2008\/04\/useful-command-lines.html Technorati Tags: Automation,...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/140\/more-cli-one-liners\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2008-05-06T16:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2013-07-02T12:13:59+00:00\" \/>\n<meta name=\"author\" content=\"Jeffery Hicks\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:site\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeffery Hicks\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/140\\\/more-cli-one-liners\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/140\\\/more-cli-one-liners\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"More CLI One-Liners\",\"datePublished\":\"2008-05-06T16:00:00+00:00\",\"dateModified\":\"2013-07-02T12:13:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/140\\\/more-cli-one-liners\\\/\"},\"wordCount\":74,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"keywords\":[\"Active Directory\",\"Automation\",\"BatchFiles\",\"CLI\",\"DHCP\",\"DNS\",\"dsquery\",\"Netsh\"],\"articleSection\":[\"PowerShell\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/140\\\/more-cli-one-liners\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/140\\\/more-cli-one-liners\\\/\",\"name\":\"More CLI One-Liners &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"datePublished\":\"2008-05-06T16:00:00+00:00\",\"dateModified\":\"2013-07-02T12:13:59+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/140\\\/more-cli-one-liners\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/140\\\/more-cli-one-liners\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/140\\\/more-cli-one-liners\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"More CLI One-Liners\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/\",\"name\":\"The Lonely Administrator\",\"description\":\"Practical Advice for the Automating IT Pro\",\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\",\"name\":\"Jeffery Hicks\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"caption\":\"Jeffery Hicks\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"More CLI One-Liners &#8226; The Lonely Administrator","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:\/\/jdhitsolutions.com\/blog\/powershell\/140\/more-cli-one-liners\/","og_locale":"en_US","og_type":"article","og_title":"More CLI One-Liners &#8226; The Lonely Administrator","og_description":"In the past I've posted a collection of command one-liners that get a ton of work done with (relatively) minimal effort. Many of these have come from Wayne Martin. I've been behind in my blogging while book writing, but I wanted to make sure you checked out his latest list at: http:\/\/waynes-world-it.blogspot.com\/2008\/04\/useful-command-lines.html Technorati Tags: Automation,...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/140\/more-cli-one-liners\/","og_site_name":"The Lonely Administrator","article_published_time":"2008-05-06T16:00:00+00:00","article_modified_time":"2013-07-02T12:13:59+00:00","author":"Jeffery Hicks","twitter_card":"summary_large_image","twitter_creator":"@JeffHicks","twitter_site":"@JeffHicks","twitter_misc":{"Written by":"Jeffery Hicks"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/140\/more-cli-one-liners\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/140\/more-cli-one-liners\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"More CLI One-Liners","datePublished":"2008-05-06T16:00:00+00:00","dateModified":"2013-07-02T12:13:59+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/140\/more-cli-one-liners\/"},"wordCount":74,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"keywords":["Active Directory","Automation","BatchFiles","CLI","DHCP","DNS","dsquery","Netsh"],"articleSection":["PowerShell"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/140\/more-cli-one-liners\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/140\/more-cli-one-liners\/","name":"More CLI One-Liners &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"datePublished":"2008-05-06T16:00:00+00:00","dateModified":"2013-07-02T12:13:59+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/140\/more-cli-one-liners\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/140\/more-cli-one-liners\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/140\/more-cli-one-liners\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},{"@type":"ListItem","position":2,"name":"More CLI One-Liners"}]},{"@type":"WebSite","@id":"https:\/\/jdhitsolutions.com\/blog\/#website","url":"https:\/\/jdhitsolutions.com\/blog\/","name":"The Lonely Administrator","description":"Practical Advice for the Automating IT Pro","publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jdhitsolutions.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9","name":"Jeffery Hicks","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","url":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","caption":"Jeffery Hicks"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg"}}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":135,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/135\/waynes-world-of-it\/","url_meta":{"origin":140,"position":0},"title":"Wayne&#8217;s World of IT","author":"Jeffery Hicks","date":"March 7, 2008","format":false,"excerpt":"One of my more popular blog entries is the one I did about CMD one-liners. These are little tidbits of commands that can get a lot done. The list came from a reader and I was happy to share. Wayne has now started a blog Wayne's World of IT which\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":64,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/64\/more-one-liners\/","url_meta":{"origin":140,"position":1},"title":"More One Liners","author":"Jeffery Hicks","date":"November 13, 2006","format":false,"excerpt":"I recently did a TipSheet column listing some of my favorite quick, one line commands. Reader Wayne was kind enough to share with me his list of oft-used one-liners which he graciously offered to share. I have not tested many of these personally, but you always test things in a\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":149,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/149\/waynes-world-of-tips\/","url_meta":{"origin":140,"position":2},"title":"Waynes World of Tips","author":"Jeffery Hicks","date":"September 22, 2008","format":false,"excerpt":"I've blogged in the past about Wayne Martin and his outstanding list of command line tips. These are one line commands, some complex some simple, that you can use to accomplish a wide range of task. The overall number of tips is to 425 and Wayne recently reorganized them into\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":25,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/25\/techmentor-dsquery-and-dsmod-examples\/","url_meta":{"origin":140,"position":3},"title":"Techmentor: DSQuery and DSMod examples","author":"Jeffery Hicks","date":"March 21, 2006","format":false,"excerpt":"During the command line scripting session, I demonstrated how to use the directory service command line tools like dsmod, dsquery and dsget. You can get syntax help by running 'dsquery \/?' (or dsmod,dsadd,dsget). There's a lot of help information so you'll probably want to pipe the results using More (dsquery\u2026","rel":"","context":"In &quot;Scripting&quot;","block_context":{"text":"Scripting","link":"https:\/\/jdhitsolutions.com\/blog\/category\/scripting\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":76,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/76\/revisit-an-old-friend\/","url_meta":{"origin":140,"position":4},"title":"Revisit an old friend","author":"Jeffery Hicks","date":"December 18, 2006","format":false,"excerpt":"I have a new blog at the SAPIEN blog that is a visit to an old friend, DosKey. Now, before you dismiss this as old-fashioned, take a moment to read the article and try it out. If you spend a lot of time at a command prompt, DosKey can make\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1708,"url":"https:\/\/jdhitsolutions.com\/blog\/commandline\/1708\/turning-cli-tools-into-powershell-tools-deep-dive-demos\/","url_meta":{"origin":140,"position":5},"title":"Turning CLI Tools into PowerShell Tools Deep Dive Demos","author":"Jeffery Hicks","date":"October 24, 2011","format":false,"excerpt":"Last week I did a presentation at the PowerShell Deep Dive in Frankfurt about turning command line tools into PowerShell tools. A video recording should be posted later. But in the meantime, here is a copy of my slide deck, in PDF and a zip file with my demos and\u2026","rel":"","context":"In &quot;CommandLine&quot;","block_context":{"text":"CommandLine","link":"https:\/\/jdhitsolutions.com\/blog\/category\/commandline\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/10\/nbtstat-n-300x158.png?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/140","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=140"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/140\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=140"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=140"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=140"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}