Richard Parmiter

Virtualisation blog and Knowledge Base

  • You are here: 
  • Home
  • Script to export all the servers in a Citrix Farm

Script to export all the servers in a Citrix Farm

Posted on April 27th, 2009

Sometimes it is useful to have a list of servers in a text file in order to perform some other task. The following script will export all servers from a Citrix Farm and add them to a text file.

This script uses the built in Citrix tool, qfarm, and cleans up the output to provide the required list. It uses a temporary file (qfarmservers.txt) during the process and deletes it at the end.

REM ***************************************************
REM qfarmservers  = output from a qfarm /servers
REM serverlist    = cleaned up list of all servers in farm
REM ***************************************************

SET qfarmservers=c:\windows\temp\qfarmservers.txt
SET serverlist=c:\windows\temp\serverlist.txt

qfarm /servers >>%qfarmServers%
for /f “skip=3 tokens=1” %%1 in (%qfarmservers%) do (
echo %%1 >> %serverlist%
Del %qfarmservers% /q

Just change the log file location(s) as required.

  • Digg
  • StumbleUpon
  • Facebook
  • Yahoo! Buzz
  • Twitter
  • Google Bookmarks
  • Add to favorites
  • FriendFeed
  • Google Buzz
  • LinkedIn
  • Live
  • MySpace
  • Reddit
  • RSS

Tags: , , , , , , , , ,
Filed under Scripts/Reg |

One Response to “Script to export all the servers in a Citrix Farm”

  1. tag cloud software Says:
    August 22nd, 2009 at 10:03 pm

    Could anyone introduce to me some free grant applications on the Internet?

Leave a Reply