Solved

Powershell and Citrix XenAPP

Posted on 2013-12-07
2
448 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
2 Comments
 
LVL 25

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Synchronize a new Active Directory domain with an existing Office 365 tenant
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

770 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