Solved

Powershell and Citrix XenAPP

Posted on 2013-12-07
2
436 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:
Tony1044 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Create and license users in Office 365 in bulk based on a CSV file. A step-by-step guide with PowerShell script examples.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

759 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now