[prev in list] [next in list] [prev in thread] [next in thread] 

List:       thin
Subject:    [THIN] Re: Delete a stale Citrix session printer from user profile
From:       Matt Kosht <matt.kosht () gmail ! com>
Date:       2012-06-21 13:03:45
Message-ID: CAHnFhBGoGiEU7mNrJcRfxKvJ7BPGxge9ozXxcLJhzeteezWEWA () mail ! gmail ! com
[Download RAW message or body]

Update on this. Found a vbscript that will do this. Will use GPO to run at
user logoff.

***
' will delete mapped printers where the name contains UNC prefix "\\"
On Error Resume Next
Set StdOut = WScript.StdOut
strComputer = "."
Set objNetwork = WScript.CreateObject("Wscript.Network")
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Printer where
Name Like '\\%'")
For Each objItem in colItems
objNetwork.RemovePrinterConnection (objItem.Name)
Next
***
On Mon, Jun 18, 2012 at 3:46 PM, Matt Kosht <matt.kosht@gmail.com> wrote:

> We recently deleted a number of Citrix session printers (mapped with
> Citrix policy settings) print mappings that used HP UPD v5.2 to new
> Citrix session printer mappings (different names) that used HP UPD
> v5.4  Some users have somehow cached old mappings (with old driver)
> which manages to reintroduce the v5.2 driver to the server they log
> into. Despite the Citrix policy being set to disallow this behavior.
>
> Is there a way (script, reg setting, etc) to force citrix to delete
> all the session printer mappings so it only has the latest ?
>

[Attachment #3 (text/html)]

<div>Update on this. Found a vbscript that will do this. Will use GPO to run at user \
logoff.</div><div> </div><div>***<br>&#39; will delete mapped printers where the name \
contains UNC prefix &quot;\\&quot;</div><div>On Error Resume Next <br> Set StdOut = \
WScript.StdOut<br>strComputer = &quot;.&quot; <br>Set objNetwork = \
WScript.CreateObject(&quot;Wscript.Network&quot;) <br>Set objWMIService = \
GetObject(&quot;winmgmts:\\&quot; &amp; strComputer &amp; &quot;\root\cimv2&quot;) \
<br> Set colItems = objWMIService.ExecQuery(&quot;Select * from Win32_Printer where \
Name Like &#39;\\%&#39;&quot;)<br>For Each objItem in colItems \
<br>objNetwork.RemovePrinterConnection (objItem.Name) <br>Next </div><div>***<br> \
</div><div class="gmail_quote">On Mon, Jun 18, 2012 at 3:46 PM, Matt Kosht <span \
dir="ltr">&lt;<a href="mailto:matt.kosht@gmail.com" \
target="_blank">matt.kosht@gmail.com</a>&gt;</span> wrote:<br><blockquote \
style="margin:0px 0px 0px \
0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" \
class="gmail_quote"> We recently deleted a number of Citrix session printers (mapped \
with<br> Citrix policy settings) print mappings that used HP UPD v5.2 to new<br>
Citrix session printer mappings (different names) that used HP UPD<br>
v5.4  Some users have somehow cached old mappings (with old driver)<br>
which manages to reintroduce the v5.2 driver to the server they log<br>
into. Despite the Citrix policy being set to disallow this behavior.<br>
<br>
Is there a way (script, reg setting, etc) to force citrix to delete<br>
all the session printer mappings so it only has the latest ?<br>
</blockquote></div><br>


************************************************
For Archives, RSS, to Unsubscribe, Subscribe or 
set Digest or Vacation mode use the below link:
http://www.freelists.org/list/thin
************************************************

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic