{"id":1591,"date":"2014-04-17T00:01:00","date_gmt":"2014-04-17T00:01:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2014\/04\/17\/windows-8-1-and-the-land-of-forgotten-modules-part-4\/"},"modified":"2014-04-17T00:01:00","modified_gmt":"2014-04-17T00:01:00","slug":"windows-8-1-and-the-land-of-forgotten-modules-part-4","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/windows-8-1-and-the-land-of-forgotten-modules-part-4\/","title":{"rendered":"Windows 8.1 and the Land of Forgotten Modules: Part 4"},"content":{"rendered":"<p><b>Summary<\/b>: Explore and discover the additional Windows PowerShell modules in Windows&nbsp;8.1.<\/p>\n<p>Honorary Scripting Guy, Sean Kearney, is here this week. Today&#039;s post is the fourth in a series, and today we&rsquo;re going to delve in the wonders of the Print Management module for Window PowerShell! You also might enjoy reading:<\/p>\n<ul>\n<li><a href=\"\/b\/heyscriptingguy\/archive\/2014\/04\/14\/windows-8-1-and-the-land-of-forgotten-modules-part-1.aspx\" target=\"_blank\">Windows 8.1 and the Land of Forgotten Modules: Part 1<\/a><\/li>\n<li><a href=\"\/b\/heyscriptingguy\/archive\/2014\/04\/15\/windows-8-1-and-the-land-of-forgotten-modules-part-2.aspx\" target=\"_blank\">Windows 8.1 and the Land of Forgotten Modules: Part&nbsp;2<\/a><\/li>\n<li><a href=\"\/b\/heyscriptingguy\/archive\/2014\/04\/16\/windows-8-1-and-the-land-of-forgotten-modules-part-3.aspx\" target=\"_blank\">Windows 8.1 and the Land of Forgotten Modules: Part&nbsp;3<\/a><\/li>\n<\/ul>\n<p>It might seem like a simple idea, but I prefer to keep as much to the console as possible. It makes any task I do easily repeatable&mdash;even something as simple as identifying printers, features, and drivers, or controlling print jobs, if needed.<\/p>\n<p>For that purpose, Windows 8.1 comes complete with a built-in Print Management module for Windows PowerShell. Let&rsquo;s crack open that baby and see the available cmdlets.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/3857.1.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/3857.1.png\" alt=\"Image of command output\" width=\"550\" height=\"259\" title=\"Image of command output\" \/><\/a><\/p>\n<p>You can see there are more than enough cmdlets to meet our daily needs. The <b>Get-Printer<\/b> cmdlet by itself is already of interest to me. It (strangely enough!) &quot;gets&quot; me a list of printers:<\/p>\n<p style=\"margin-left:30px\">Get-Printer<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/5611.2.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/5611.2.png\" alt=\"Image of command output\" title=\"Image of command output\" \/><\/a><\/p>\n<p>But where it gets cool is how we can pull up additional information. If we combine it with the <b>Get-PrintConfiguration<\/b>, we can identify all of our printer features as objects:<\/p>\n<p style=\"margin-left:30px\">Get-Printer | Get-PrintConfiguration<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/1778.3.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/1778.3.png\" alt=\"Image of command output\" title=\"Image of command output\" \/><\/a><\/p>\n<p>Provided we have local rights on the remote system, we can check on print jobs from Windows PowerShell directly:<\/p>\n<p style=\"margin-left:30px\">Get-Printjob &ndash;Printername &ldquo;Laserjet5&rdquo; &ndash;computername &ldquo;Contoso-FPS&rdquo;<\/p>\n<p>Or if you&rsquo;re about to do maintenance on a remote printer, you can send a command via Windows PowerShell to suspend print jobs on one printer:<\/p>\n<p style=\"margin-left:30px\">Get-Printer &ndash;name &ldquo;Laserjet5&rdquo; | Get-Printjob | Suspend-Printjob<\/p>\n<p>Or perhaps you need to suspend all print jobs for all the printers? A minor change in the command:<\/p>\n<p style=\"margin-left:30px\">Get-Printer | Get-Printjob | Suspend-Printjob<\/p>\n<p>So now you&rsquo;ve finished working on the printers, and you plug in their cables again. The staff has put away their torches and would like to get back to work. Let&rsquo;s allow them to resume printing!<\/p>\n<p style=\"margin-left:30px\">Get-Printer | Get-Printjob | Resume-Printjob<\/p>\n<p>All of these are able to access computers remotely, so you could actually specify a list of print servers to pause for maintenance tasks.<\/p>\n<p>Now here is an issue that used to drive me bananas&hellip;<\/p>\n<p>After I updated printers to a newer model in the office, the central printers would maintain their names but have the newer drivers. I&rsquo;d have to go about manually deleting the drivers on the servers! Not anymore!<\/p>\n<p>Hello magical PowerShell Genie! I would like you to remove the driver for the now defunct LaserJet 1 printer:<\/p>\n<p style=\"margin-left:30px\">Remove-Printerdriver &ldquo;Laserjet 1&rdquo;<\/p>\n<p>Now here is a neat little task I ran across. You can use the same cmdlets to set up a rudimentary print share.<\/p>\n<p>Let&rsquo;s pick on my LaserJet 1 again. Let&rsquo;s imagine I put it on the server and would like to share that printer as PRINTER01. With the Print Management module, I can use this simple line:<\/p>\n<p style=\"margin-left:30px\">Set-Printer &ndash;name &ldquo;Laserjet1&rdquo; &ndash;Sharename &ldquo;PRINTER01&rdquo; &ndash;shared $TRUE<\/p>\n<p>Or if you like, you could just as easily pick a better name, for example, &ldquo;AccountingPrinter01&rdquo;, and rename it:<\/p>\n<p style=\"margin-left:30px\">Set-Printer &ndash;name &ldquo;Laserjet 1&rdquo; &ndash;Sharename &ldquo;AccountingPrinter01&rdquo; &ndash;shared $TRUE<\/p>\n<p>All of this ability to manage printers so easily&hellip;<\/p>\n<p>It makes me&hellip;*sniff, sniff*&hellip;miss managing printers!<\/p>\n<p>Stop by tomorrow and we&rsquo;ll dig around to see the last of my little nugget discoveries.<\/p>\n<p>I invite you to follow The Scripting Guys on <a href=\"http:\/\/bit.ly\/scriptingguystwitter\" target=\"_blank\">Twitter<\/a> and <a href=\"http:\/\/bit.ly\/scriptingguysfacebook\" target=\"_blank\">Facebook<\/a>. If you have any questions, send an email to The Scripting Guys at <a href=\"mailto:scripter@microsoft.com\" target=\"_blank\">scripter@microsoft.com<\/a>, or post your questions on the <a href=\"http:\/\/bit.ly\/scriptingforum\" target=\"_blank\">Official Scripting Guys Forum<\/a>. See you tomorrow. Until then remember eat your cmdlets each and every day with a taste dash of creativity.<\/p>\n<p><b>Sean Kearney<\/b>, Windows PowerShell MVP and Honorary Scripting Guy<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary: Explore and discover the additional Windows PowerShell modules in Windows&nbsp;8.1. Honorary Scripting Guy, Sean Kearney, is here this week. Today&#039;s post is the fourth in a series, and today we&rsquo;re going to delve in the wonders of the Print Management module for Window PowerShell! You also might enjoy reading: Windows 8.1 and the Land [&hellip;]<\/p>\n","protected":false},"author":596,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[56,154,45],"class_list":["post-1591","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-guest-blogger","tag-sean-kearney","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>Summary: Explore and discover the additional Windows PowerShell modules in Windows&nbsp;8.1. Honorary Scripting Guy, Sean Kearney, is here this week. Today&#039;s post is the fourth in a series, and today we&rsquo;re going to delve in the wonders of the Print Management module for Window PowerShell! You also might enjoy reading: Windows 8.1 and the Land [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/1591","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/596"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=1591"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/1591\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=1591"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=1591"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=1591"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}