<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Get-Printer</title>
	<atom:link href="http://jdhitsolutions.com/blog/2009/10/get-printer/feed/" rel="self" type="application/rss+xml" />
	<link>http://jdhitsolutions.com/blog/2009/10/get-printer/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=get-printer</link>
	<description>Advice, solutions, tips and more for the lonely Windows administrator with too much to do and not enough time.</description>
	<lastBuildDate>Tue, 07 Feb 2012 16:20:17 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Darrin Henshaw</title>
		<link>http://jdhitsolutions.com/blog/2009/10/get-printer/#comment-292</link>
		<dc:creator>Darrin Henshaw</dc:creator>
		<pubDate>Fri, 16 Oct 2009 19:21:50 +0000</pubDate>
		<guid isPermaLink="false">http://jdhitsolutions.com/blog/2009/10/get-printer/#comment-292</guid>
		<description>Lol, I&#039;m glad I&#039;m not the only one with that failing.</description>
		<content:encoded><![CDATA[<p>Lol, I&#8217;m glad I&#8217;m not the only one with that failing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeffery Hicks</title>
		<link>http://jdhitsolutions.com/blog/2009/10/get-printer/#comment-291</link>
		<dc:creator>Jeffery Hicks</dc:creator>
		<pubDate>Fri, 16 Oct 2009 19:19:58 +0000</pubDate>
		<guid isPermaLink="false">http://jdhitsolutions.com/blog/2009/10/get-printer/#comment-291</guid>
		<description>I &lt;strong&gt;&lt;em&gt;totally&lt;/em&gt;&lt;/strong&gt; overthought this and made it much more complicated than necessary. I have no idea where my head was.

gwmi win32_printer &#124; select Name</description>
		<content:encoded><![CDATA[<p>I <strong><em>totally</em></strong> overthought this and made it much more complicated than necessary. I have no idea where my head was.</p>
<p>gwmi win32_printer | select Name</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darrin Henshaw</title>
		<link>http://jdhitsolutions.com/blog/2009/10/get-printer/#comment-290</link>
		<dc:creator>Darrin Henshaw</dc:creator>
		<pubDate>Fri, 16 Oct 2009 19:10:42 +0000</pubDate>
		<guid isPermaLink="false">http://jdhitsolutions.com/blog/2009/10/get-printer/#comment-290</guid>
		<description>Should have refreshed my screen as I was posting. Definitely the one line is much better. That&#039;s one failing I have is I tend to use more code than neccessary, sometimes makes the script easier to look at and see what&#039;s happening, but sometimes makes it worse.</description>
		<content:encoded><![CDATA[<p>Should have refreshed my screen as I was posting. Definitely the one line is much better. That&#8217;s one failing I have is I tend to use more code than neccessary, sometimes makes the script easier to look at and see what&#8217;s happening, but sometimes makes it worse.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darrin Henshaw</title>
		<link>http://jdhitsolutions.com/blog/2009/10/get-printer/#comment-289</link>
		<dc:creator>Darrin Henshaw</dc:creator>
		<pubDate>Fri, 16 Oct 2009 19:07:12 +0000</pubDate>
		<guid isPermaLink="false">http://jdhitsolutions.com/blog/2009/10/get-printer/#comment-289</guid>
		<description>True, I tested it out and all it really needed was the name. Also, never really used Out-Printer before but I can see many uses for it now, particularly the PDF option you mentioned, thanks for the post very useful.

Cheers,

Darrin Henshaw
Twitter: @darrin.henshaw</description>
		<content:encoded><![CDATA[<p>True, I tested it out and all it really needed was the name. Also, never really used Out-Printer before but I can see many uses for it now, particularly the PDF option you mentioned, thanks for the post very useful.</p>
<p>Cheers,</p>
<p>Darrin Henshaw<br />
Twitter: @darrin.henshaw</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeffery Hicks</title>
		<link>http://jdhitsolutions.com/blog/2009/10/get-printer/#comment-288</link>
		<dc:creator>Jeffery Hicks</dc:creator>
		<pubDate>Fri, 16 Oct 2009 19:04:40 +0000</pubDate>
		<guid isPermaLink="false">http://jdhitsolutions.com/blog/2009/10/get-printer/#comment-288</guid>
		<description>If you forget all the stuff about ports, all that matters is the name and I think all you really need is this one liner:

(get-item &quot;hkcu:\Software\Microsoft\Windows NT\CurrentVersion\PrinterPorts&quot;).GetValueNames()

Use the name as listed for Out-Printer.  Networked printers need the UNC. You can still turn this into a function if you&#039;d like:

Function Get-Printer { (get-item &quot;hkcu:\Software\Microsoft\Windows NT\CurrentVersion\PrinterPorts&quot;).GetValueNames() }

That&#039;s much easier, don&#039;t you think?</description>
		<content:encoded><![CDATA[<p>If you forget all the stuff about ports, all that matters is the name and I think all you really need is this one liner:</p>
<p>(get-item &#8220;hkcu:\Software\Microsoft\Windows NT\CurrentVersion\PrinterPorts&#8221;).GetValueNames()</p>
<p>Use the name as listed for Out-Printer.  Networked printers need the UNC. You can still turn this into a function if you&#8217;d like:</p>
<p>Function Get-Printer { (get-item &#8220;hkcu:\Software\Microsoft\Windows NT\CurrentVersion\PrinterPorts&#8221;).GetValueNames() }</p>
<p>That&#8217;s much easier, don&#8217;t you think?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeffery Hicks</title>
		<link>http://jdhitsolutions.com/blog/2009/10/get-printer/#comment-287</link>
		<dc:creator>Jeffery Hicks</dc:creator>
		<pubDate>Fri, 16 Oct 2009 18:33:51 +0000</pubDate>
		<guid isPermaLink="false">http://jdhitsolutions.com/blog/2009/10/get-printer/#comment-287</guid>
		<description>I totally forgot about network printers.  I&#039;ve been using locally attached printers for so long that it never even crossed my mind.  The name is the important part anyway.</description>
		<content:encoded><![CDATA[<p>I totally forgot about network printers.  I&#8217;ve been using locally attached printers for so long that it never even crossed my mind.  The name is the important part anyway.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darrin Henshaw</title>
		<link>http://jdhitsolutions.com/blog/2009/10/get-printer/#comment-286</link>
		<dc:creator>Darrin Henshaw</dc:creator>
		<pubDate>Fri, 16 Oct 2009 18:19:45 +0000</pubDate>
		<guid isPermaLink="false">http://jdhitsolutions.com/blog/2009/10/get-printer/#comment-286</guid>
		<description>Hey Jeff,

Grabbed your function and started testing with it. Works great for local printers, but it didn&#039;t even notice my networked ones. Checked the registry key and there were no entries for my network printers.

Made a little switch, and used a different registry key but doesn&#039;t have information like driver and port:

function Get-Printer {

    $printers = @(Get-ChildItem &#039;registry::\HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion&#039;&#124;where {$_.name -match &quot;PrinterPorts&quot;}&#124;Select-Object -expand property)

	foreach ($printer in $printers) {
		$Name=$printer.ToString()
    
        $obj=New-Object PSObject
        $obj &#124; Add-Member -MemberType NoteProperty -Name &quot;Name&quot; -Value $Name
       
       write $obj
    
    } #end ForEach

} #End Function

Set-Alias gpr Get-Printer
Get-Printer


No doubt there are other ways of doing it, but I thought to mention it. Cheers.</description>
		<content:encoded><![CDATA[<p>Hey Jeff,</p>
<p>Grabbed your function and started testing with it. Works great for local printers, but it didn&#8217;t even notice my networked ones. Checked the registry key and there were no entries for my network printers.</p>
<p>Made a little switch, and used a different registry key but doesn&#8217;t have information like driver and port:</p>
<p>function Get-Printer {</p>
<p>    $printers = @(Get-ChildItem &#8216;registry::\HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion&#8217;|where {$_.name -match &#8220;PrinterPorts&#8221;}|Select-Object -expand property)</p>
<p>	foreach ($printer in $printers) {<br />
		$Name=$printer.ToString()</p>
<p>        $obj=New-Object PSObject<br />
        $obj | Add-Member -MemberType NoteProperty -Name &#8220;Name&#8221; -Value $Name</p>
<p>       write $obj</p>
<p>    } #end ForEach</p>
<p>} #End Function</p>
<p>Set-Alias gpr Get-Printer<br />
Get-Printer</p>
<p>No doubt there are other ways of doing it, but I thought to mention it. Cheers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darrin Henshaw</title>
		<link>http://jdhitsolutions.com/blog/2009/10/get-printer/#comment-285</link>
		<dc:creator>Darrin Henshaw</dc:creator>
		<pubDate>Fri, 16 Oct 2009 16:34:59 +0000</pubDate>
		<guid isPermaLink="false">http://jdhitsolutions.com/blog/2009/10/get-printer/#comment-285</guid>
		<description>Perfect, thanks Jeff.</description>
		<content:encoded><![CDATA[<p>Perfect, thanks Jeff.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeffery Hicks</title>
		<link>http://jdhitsolutions.com/blog/2009/10/get-printer/#comment-284</link>
		<dc:creator>Jeffery Hicks</dc:creator>
		<pubDate>Fri, 16 Oct 2009 16:07:01 +0000</pubDate>
		<guid isPermaLink="false">http://jdhitsolutions.com/blog/2009/10/get-printer/#comment-284</guid>
		<description>I fixed the download link.  Please try again.</description>
		<content:encoded><![CDATA[<p>I fixed the download link.  Please try again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darrin Henshaw</title>
		<link>http://jdhitsolutions.com/blog/2009/10/get-printer/#comment-283</link>
		<dc:creator>Darrin Henshaw</dc:creator>
		<pubDate>Fri, 16 Oct 2009 15:55:22 +0000</pubDate>
		<guid isPermaLink="false">http://jdhitsolutions.com/blog/2009/10/get-printer/#comment-283</guid>
		<description>Nice Jeff, very handy. However, the download link doesn&#039;t seem to work :)</description>
		<content:encoded><![CDATA[<p>Nice Jeff, very handy. However, the download link doesn&#8217;t seem to work <img src='http://jdhitsolutions.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

