List printer drivers on each server in the farm

Added by Citrix CDN , last edited by Citrix CDN on Nov 10, 2007  (view change)
Tags: 

A simple list to all  printer drivers on each server in the farm

Description

The script below enumerated through all the servers in the farm and for each server it prints out printer driver name.

Please refer to MFCOM admin guide for more on printer driver API.

Download

 download here.

Code Snippet

<package>
    <job id="PrinterDrivers">
        <comment>
        File:           PrinterDrivers.wsf
        Description:    List printer drivers on each server in the farm.
        Requirements:   WSH 5.5 or higher.
       
        Copyright (c) 2007 Citrix Systems, Inc.
        </comment>
        <runtime>
            <description>
                List printer drivers on each server in the farm.
            </description>
            <example>
                CScript //nologo PrinterDrivers.wsf
            </example>
 
        </runtime>
        <reference object="MetaFrameCOM.MetaFrameFarm"/>
        <script language="VBScript">
       
            Dim theFarm, aServer, aDriver

            '
            ' Create MetaFrameFarm object
            '
            Set theFarm = CreateObject("MetaFrameCOM.MetaFrameFarm")
            '
            ' Initialize the farm object.
            '
            theFarm.Initialize(MetaFrameWinFarmObject)
            '
            ' Are you Citrix Administrator?
            '
            if theFarm.WinFarmObject.IsCitrixAdministrator = 0 then
                WScript.Echo "You must be a Citrix admin to run this script"
                WScript.Echo ""
                WScript.Quit 0
            End If
            '
            ' Print out the farm name.
            '
            WScript.Echo "MetaFrame Farm Name: " & theFarm.FarmName
            WScript.Echo ""
            '
            ' Display all printer drivers on the servers in the farm.
            '
            WScript.Echo "Printer Drivers on all the servers in the farm (" & Now & ")"
            WScript.Echo "------------------------------------------------"

            For Each aServer In theFarm.Servers
                WScript.Echo "Server Name  : " & aServer.ServerName
  WScript.Echo ""
  For Each aDriver In aServer.PrinterDrivers
   WScript.Echo "Printer Driver Name : " & aDriver.DriverName
  Next
  
  WScript.Echo "------------------------------------------------"
            Next
           
     
        </script>
    </job>
</package>

User Rating?

Disclaimer

These software applications are provided to you as is with no representations, warranties or conditions of any kind. You may use and distribute it at your own risk. CITRIX DISCLAIMS ALL WARRANTIES WHATSOEVER, EXPRESS, IMPLIED, WRITTEN, ORAL OR STATUTORY, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NONINFRINGEMENT. Without limiting the generality of the foregoing, you acknowledge and agree that (a) the software application may exhibit errors, design flaws or other problems, possibly resulting in loss of data or damage to property; (b) it may not be possible to make the software application fully functional; and (c) Citrix may, without notice or liability to you, cease to make available the current version and/or any future versions of the software application. In no event should the code be used to support of ultra-hazardous activities, including but not limited to life support or blasting activities. NEITHER CITRIX NOR ITS AFFILIATES OR AGENTS WILL BE LIABLE, UNDER BREACH OF CONTRACT OR ANY OTHER THEORY OF LIABILITY, FOR ANY DAMAGES WHATSOEVER ARISING FROM USE OF THE SOFTWARE APPLICATION, INCLUDING WITHOUT LIMITATION DIRECT, SPECIAL, INCIDENTAL, PUNITIVE, CONSEQUENTIAL OR OTHER DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. You agree to indemnify and defend Citrix against any and all claims arising from your use, modification or distribution of the code.

  • Add to Bookmarks