<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>http://piszczynski.com/index.php?action=history&amp;feed=atom&amp;title=Printer_scripts</id>
	<title>Printer scripts - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://piszczynski.com/index.php?action=history&amp;feed=atom&amp;title=Printer_scripts"/>
	<link rel="alternate" type="text/html" href="http://piszczynski.com/index.php?title=Printer_scripts&amp;action=history"/>
	<updated>2026-10-28T05:02:00Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.40.1</generator>
	<entry>
		<id>http://piszczynski.com/index.php?title=Printer_scripts&amp;diff=622&amp;oldid=prev</id>
		<title>Aleks: 2 revisions imported</title>
		<link rel="alternate" type="text/html" href="http://piszczynski.com/index.php?title=Printer_scripts&amp;diff=622&amp;oldid=prev"/>
		<updated>2023-11-15T20:32:20Z</updated>

		<summary type="html">&lt;p&gt;2 revisions imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 21:32, 15 November 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en-GB&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Aleks</name></author>
	</entry>
	<entry>
		<id>http://piszczynski.com/index.php?title=Printer_scripts&amp;diff=621&amp;oldid=prev</id>
		<title>piszczynski&gt;Aleks at 15:51, 23 March 2021</title>
		<link rel="alternate" type="text/html" href="http://piszczynski.com/index.php?title=Printer_scripts&amp;diff=621&amp;oldid=prev"/>
		<updated>2021-03-23T15:51:09Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:51, 23 March 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;== Find Print Servers in a Domain ==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;This will show all servers in the active directory with the print management role. &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;*Import-Module ActiveDirectory&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;**Get-ADObject -LDAPFilter &quot;(&amp;amp;(&amp;amp;(&amp;amp;(uncName=*)(objectCategory=printQueue))))&quot; -properties *|Sort-Object -Unique -Property servername | select servername&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Powershell script to uninstall printer drivers and associated printer ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Powershell script to uninstall printer drivers and associated printer ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>piszczynski&gt;Aleks</name></author>
	</entry>
	<entry>
		<id>http://piszczynski.com/index.php?title=Printer_scripts&amp;diff=620&amp;oldid=prev</id>
		<title>31.3.228.2: Created page with &quot; == Powershell script to uninstall printer drivers and associated printer ==  { ---------------------------------  write-host &quot;Powershell version pre-5.1, running legacy scrip...&quot;</title>
		<link rel="alternate" type="text/html" href="http://piszczynski.com/index.php?title=Printer_scripts&amp;diff=620&amp;oldid=prev"/>
		<updated>2019-04-09T13:33:32Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot; == Powershell script to uninstall printer drivers and associated printer ==  { ---------------------------------  write-host &amp;quot;Powershell version pre-5.1, running legacy scrip...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
== Powershell script to uninstall printer drivers and associated printer ==&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
---------------------------------&lt;br /&gt;
&lt;br /&gt;
write-host &amp;quot;Powershell version pre-5.1, running legacy script.&amp;quot;&lt;br /&gt;
$targetpc =  read-host &amp;quot;Enter target PC name&amp;quot;&lt;br /&gt;
$printernames = (Get-WmiObject Win32_PrinterDriver -ComputerName $targetpc).Name&lt;br /&gt;
$count = 0&lt;br /&gt;
Foreach ($printername in $printernames) &lt;br /&gt;
    {&lt;br /&gt;
    if (!($printername.Contains(&amp;#039;Microsoft&amp;#039;)))&lt;br /&gt;
        {&lt;br /&gt;
        Write-Host &amp;quot;[$count] - $printername&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
    $count++&lt;br /&gt;
    }&lt;br /&gt;
$input = read-host &amp;quot;Select number printer to remove&amp;quot;&lt;br /&gt;
$printer = (($printernames[$input]).Split(&amp;quot;,&amp;quot;))[0]&lt;br /&gt;
$version = (($printernames[$input]).Split(&amp;quot;,&amp;quot;))[1]&lt;br /&gt;
$os = ((($printernames[$input]).Split(&amp;quot;,&amp;quot;))[2]).Split(&amp;quot; &amp;quot;)[1]&lt;br /&gt;
&lt;br /&gt;
$printerdrivers = (Get-WmiObject Win32_PrinterDriver -ComputerName $targetpc).Name&lt;br /&gt;
foreach ($printername in $printernames) &lt;br /&gt;
    {&lt;br /&gt;
    if($printer -eq $printername)&lt;br /&gt;
        {&lt;br /&gt;
        get-service -name spooler -ComputerName $targetpc&lt;br /&gt;
        rename-item -path &amp;quot;hklm:\system\currentcontrolset\control\print\environments\windows x64\print processors\winprint&amp;quot; -newname winprint.old &lt;br /&gt;
        Get-Service -Name &amp;quot;spooler&amp;quot; | Set-Service -Status Running&lt;br /&gt;
        get-service -name spooler&lt;br /&gt;
        rundll32 printui.dll,PrintUIEntry /dd /m &amp;quot;$printer&amp;quot; /h &amp;quot;$os&amp;quot; /v $version&lt;br /&gt;
        get-service -name spooler | stop-service -force&lt;br /&gt;
        rename-item -path &amp;quot;hklm:\system\currentcontrolset\control\print\environments\windows x64\print processors\winprint.old&amp;quot; -newname winprint&lt;br /&gt;
        Get-Service -Name &amp;quot;spooler&amp;quot; | Set-Service -Status Running&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
$printernames = (Get-WmiObject -class win32_printer -ComputerName $targetpc -Recurse)&lt;br /&gt;
$printernames&lt;br /&gt;
&lt;br /&gt;
#clear variables&lt;br /&gt;
$count = $null&lt;br /&gt;
$printernames = $null&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-----------------------------&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>31.3.228.2</name></author>
	</entry>
</feed>