Solved

Powershell and Citrix XenAPP

Posted on 2013-12-07
2
458 Views
Last Modified: 2014-02-23
I need to write a script to take a list of servers off the farm for maintenance.

Here are the steps I preform to change Load Evaluator
12345678
0
Comment
Question by:Leo Torres
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 26

Accepted Solution

by:
Tony Johncock earned 500 total points
ID: 39705532
So from your screen shots you appear to be using XenApp 6.0 or earlier?

For XA 6.0 and earlier with the XenApp PowerShell extensions installed:

To remove the list of servers from load:
$File = get-content c:\scripts\servers.txt
for each ($server in $File) {
Set-XAServerLoadEvaluator $server Unavailable
Write-Host "Server $server moved into Load Balancer Unavailable"
}

To bring them back into load:
$File = get-content c:\scripts\servers.txt
for each ($server in $File) {
Set-XAServerLoadEvaluator $server Default
Write-Host "Server $server moved into Load Balancer Default"
}

For reference, Citrix removed that command from XA6.5 so should you wish to do the same thing on 6.5 at some point:

To remove the list of servers from load:

$File = get-content c:\scripts\servers.txt
for each ($server in $File) {
Set-ItemProperty -Path LocalFarmGpo:\Computer\Unfiltered\Settings\ServerSettings\LoadEvaluator -Name Value -Value Unavailable
Write-Host "Server $server moved into Load Balancer Unavailable"
}

To bring them back into load:

$File = get-content c:\scripts\servers.txt
for each ($server in $File) {
Set-ItemProperty -Path LocalFarmGpo:\Computer\Unfiltered\Settings\ServerSettings\LoadEvaluator -Name Value -Value Default
Write-Host "Server $server moved into Load Balancer Default"
}

Please note:

I haven't imported the relevant powershell modules as part of the script - I'll leave that for you to work out.

scripts.txt contains one server name per line and is a simple text file.
0
 
LVL 8

Author Closing Comment

by:Leo Torres
ID: 39880757
Sorry I took so long.. I hav not tried i will give you credit and test tonight at the office
0

Featured Post

Learn by Doing. Anytime. Anywhere.

Do you like to learn by doing?
Our labs and exercises give you the chance to do just that: Learn by performing actions on real environments.

Hands-on, scenario-based labs give you experience on real environments provided by us so you don't have to worry about breaking anything.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This script can help you clean up your user profile database by comparing profiles to Active Directory users in a particular OU, and removing the profiles that don't match.
A recent project that involved parsing Tableau Desktop and Server log files to extract reusable user queries for use in other systems. I chose to use PowerShell to gather the data, and SharePoint to present it...
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question