?
Solved

Powershell and Citrix XenAPP

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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
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 the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

649 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