?
Solved

Powershell and Citrix XenAPP

Posted on 2013-12-07
2
Medium Priority
?
484 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 26

Accepted Solution

by:
Tony J earned 2000 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

What Security Threats Are We Predicting for 2018?

Cryptocurrency, IoT botnets, MFA, and more! Hackers are already planning their next big attacks for 2018. Learn what you might face, and how to defend against it with our 2018 security predictions.

Question has a verified solution.

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

Auditing domain password hashes is a commonly overlooked but critical requirement to ensuring secure passwords practices are followed. Methods exist to extract hashes directly for a live domain however this article describes a process to extract u…
In the absence of a fully-fledged GPO Management product like AGPM, the script in this article will provide you with a simple way to watch the domain (or a select OU) for GPOs changes and automatically take backups when policies are added, removed o…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Screencast - Getting to Know the Pipeline
Suggested Courses
Course of the Month13 days, 19 hours left to enroll

807 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