VMware Horizon Community
schepp
Leadership
Leadership
Jump to solution

Network Printer unmap vs. export

Hello,

I'd like to use mapped network printers via UEM environment, as well as allowing the users to add persistant printers themself.

I use the Printer Common Setting template and the mapped printers are saved in to the profile archive.

Problem is that the unmap command of the printers is run after the pinter settings are exported, so the user will have the once mapped printers attached to his new session, even if I remove him from the printer-group as the mapping is stored in his profile.

Any ideas how to remove the UEM-mapped printers from the printer-profile?

Thanks

1 Solution

Accepted Solutions
DEMdev
VMware Employee
VMware Employee
Jump to solution

Hi schepp,

I hope to make this easier in the future, but for now you would have to use a workaround similar to the following:

  • Configure all printers mapped through UEM as Undo at logoff and refresh during printer mapping refresh, and give them an (additional) condition that always results in a match at logon and during the session, but that we can manually cause not to match at logoff.
  • At logoff, before export, make that condition not match and perform a UEM refresh for the printers, causing the UEM-mapped ones to be unmapped.

Easy, no? 🙂 Let's (hopefully) clarify this a bit with an example.

On all your UEM printer mapping definitions, configure the following (additional) condition:

pastedImage_4.png

This means that those printer mappings will only be created if that particular registry key exists.

To create that key at logon, create a UEM Logon Task:

pastedImage_5.png

Be sure to configure the logon task to run Before profile archive import, so that it executes before we start processing printer mappings.

At logoff, we want to remove the registry key, so that the printer mappings' conditions no longer match. You basically want to run a script that does the following:


     C:\Windows\System32\reg.exe DELETE HKCU\Software\PrinterMappingWorkaround /f

     "C:\Program Files\Immidio\Flex Profiles\FlexEngine.exe" -UEMRefreshPrinters

You can run that script from a UEM Logoff Task (configured to run Before profile archive export) – probably the easiest to configure, but that approach has the downside that the UEM refresh will log to FlexEngine-1.log as the main log file is already in use. The alternative would be to incorporate the registry key deletion and the UEM refresh in the logoff script, prior to calling FlexEngine.exe -s.

As I said, I hope to make this easier in the future 🙂

View solution in original post

Reply
0 Kudos
5 Replies
DEMdev
VMware Employee
VMware Employee
Jump to solution

Hi schepp,

I hope to make this easier in the future, but for now you would have to use a workaround similar to the following:

  • Configure all printers mapped through UEM as Undo at logoff and refresh during printer mapping refresh, and give them an (additional) condition that always results in a match at logon and during the session, but that we can manually cause not to match at logoff.
  • At logoff, before export, make that condition not match and perform a UEM refresh for the printers, causing the UEM-mapped ones to be unmapped.

Easy, no? 🙂 Let's (hopefully) clarify this a bit with an example.

On all your UEM printer mapping definitions, configure the following (additional) condition:

pastedImage_4.png

This means that those printer mappings will only be created if that particular registry key exists.

To create that key at logon, create a UEM Logon Task:

pastedImage_5.png

Be sure to configure the logon task to run Before profile archive import, so that it executes before we start processing printer mappings.

At logoff, we want to remove the registry key, so that the printer mappings' conditions no longer match. You basically want to run a script that does the following:


     C:\Windows\System32\reg.exe DELETE HKCU\Software\PrinterMappingWorkaround /f

     "C:\Program Files\Immidio\Flex Profiles\FlexEngine.exe" -UEMRefreshPrinters

You can run that script from a UEM Logoff Task (configured to run Before profile archive export) – probably the easiest to configure, but that approach has the downside that the UEM refresh will log to FlexEngine-1.log as the main log file is already in use. The alternative would be to incorporate the registry key deletion and the UEM refresh in the logoff script, prior to calling FlexEngine.exe -s.

As I said, I hope to make this easier in the future 🙂

Reply
0 Kudos
schepp
Leadership
Leadership
Jump to solution

Hi UEMdev​,

thanks for the answer, or should I say "holy workaround, Batman"? Smiley Happy

Wouldn't it be usefull for network printers and also network drives to get unmapped before the profile export in general?

Or at least have the option to choose when to unmap them?

Hope that will get implemented in a not too far future.

For now it seems like I have to add a second condition to the 163 printer mappings. Good thing we have the powershell 🙂

Thanks,

Tim

DEMdev
VMware Employee
VMware Employee
Jump to solution

Hi schepp,

Yes, "holy workaround, Batman!" is definitely appropriate here 🙂

And, yes, it would be useful for unmapping of printers and drives to take place before profile archive export, but we can't just change existing behavior as other customers might depend on that (one of their "after export" logoff scripts might depend on a drive that's mapped by UEM, for instance).

I'll try to tackle it in one of the upcoming releases. It would have to be configurable, with the current behavior as the default. No guarantees, but I'll give it some more thought now that it has come up again 🙂

schepp
Leadership
Leadership
Jump to solution

Hi UEMdev

the workaround is running good. Except one thing: As we unmap the printers before the archive export, the user based settings for the printer, like format, double-sided printing etc. are not persistent for the user. You know a quick way to only save those settings and not the whole device?

Thanks

Tim

Reply
0 Kudos
DEMdev
VMware Employee
VMware Employee
Jump to solution

Hi schepp,

Sorry, no. I guess you'll have to experiment a bit with capturing just a subset of the info under HKCU\Printers, unless someone else on the forum has an idea?

Reply
0 Kudos