VMware Horizon Community
don1304
Contributor
Contributor

Can we restrict printers from a VIEW virtual desktop?

Can we restrict printers from a virtual desktop in View enviornment ?   As we want to restrict all remote users to restrict printing from local  printer and network printers.

0 Kudos
6 Replies
bradstaenglen
Contributor
Contributor

When you install the View Agent on to the desktop, don't install virtual printing and this should take care of it!

0 Kudos
don1304
Contributor
Contributor

Thanks , Does this restrict only USB printing ?  OR both Network printing and USB printing ?

0 Kudos
vSolid
Enthusiast
Enthusiast

Yes you can, but you need to create a pool and then create a VMs in VLAN in vsphere env

And then let network team to create a rule for this VLAN to assess to some share ip printers

Sent from my iPad

0 Kudos
bradstaenglen
Contributor
Contributor

Disabling Virtual Printing blocks any printers already on the local machine and should prevent the addition of other printers. I am uncertain about the USB printer being blocked by this, we dont allow USB via GPO so it isn't an issue in our environment :smileyplain:

0 Kudos
cmartin24
Enthusiast
Enthusiast

I believe what you may be asking is...we have some printers - BUT, we don't want all of them to be redirected in a View session - just certain ones..?  I have the same issue and the problem is I don't have access to the client printers.   Has anyone found a possible solution for this?  Perhaps a script to run after the user logs in that deletes the printers that you want to restrict.

0 Kudos
btrabue
Enthusiast
Enthusiast

I found the following login script (untested) that will check to see if the user is connecting from outside the office and if they are a member of a certain AD group.  If all passes then they are allowed to print.  If you wanted to disable all external USB printing then just disable the TP Autoconnect Service and the TP VC Gateway Service and they will not be able to print to any type of USB printer including label printers.

  • strComputer = "."
  • Set objNetwork =
    WScript.CreateObject("Wscript.Network")
  • Set objSysInfo = CreateObject("ADSystemInfo" )
  • strUserDN = objSysInfo.userName
  • Set objUser = GetObject("LDAP://" &
    strUserDN)
  • Set objWMIService = GetObject("winmgmts:\\"
    & strComputer & "\root\cimv2")
  • Set objShell = CreateObject("WScript.Shell")
  • '--------------------------------------------------------
  • ' IsMember Function
  • '--------------------------------------------------------
  • Function IsMember(strGroup)
  • ' Function to test one user for group membership.
  • ' objUser is the user object with global scope.
  • ' strGroup is the NT Name of the group to test.
  • ' objGroupList is a dictionary object with global scope.
  • ' Returns True if the user is a member of the group.
  • Dim objGroup
  • If IsEmpty(objGroupList) Then
  • Set objGroupList =
    CreateObject("Scripting.Dictionary" )
  • objGroupList.CompareMode = vbTextCompare
  • For Each objGroup In objUser.Groups
  • objGroupList(objGroup.sAMAccountName) = True
  • Next
  • End If
  • IsMember = objGroupList.Exists(strGroup)
  • End Function
  • '--------------------------------------------------------
  • ' Check to see if client logged into external View
    Connection Servers
  • ' Disable printing if not member of AD Group
    remote-printing-allowed
  • '--------------------------------------------------------
  • If
    objShell.ExpandEnvironmentStrings("%ViewClient_Broker_DNS_Name%") =
    "GR1VCSV01.domain.net"
    _
  • Or
    objShell.ExpandEnvironmentStrings("%ViewClient_Broker_DNS_Name%") =
    "GR1VCSV02.domain.net"
    _
  • Then
  • If IsMember("remote-printing-allowed") Then
  • echo "Virtual Printing Enabled"
  • Else
  • Set colServiceList = objWMIService.ExecQuery _
  • ("Select * from Win32_Service where Name =
    'TPAutoConnSvc' OR Name = 'TPVCGateway'")
  • For Each objService in colServiceList
  • If objService.State = "Running" Then
  • objService.StopService()
  • Wscript.Sleep 5000
  • End If
  • errReturnCode =
    objService.ChangeStartMode("Disabled")
  • end if
  • end If
0 Kudos