XenApp: Looking for the Powershell script
-
Wednesday, June 27, 2012 7:16 PM
I am very new to powershell and below are my
requirements. Would it be possible for you to help me
with this:
I was looking for the Powershell script to do the
below:
1. Read the list of Citrix server from the text file.
2. Export the LE (LoadEvaluator) applied to each of
the servers in the text.
3. Apply the LE named "Offline".
4. Check for the user connected to the servers logoff
the Dissconnected and Idle more than 1 hour.
5. Wait for some time
6. Re-apply the LE what was there before.
I achived Pt # 1 till 3. Below is the snippet. Would
it be possible for you to help me more on this?
I am very new (4 days old) to powershell So point
out my mistakes and let me correct it.
If reply is ASAP, helpful for me plzz.
foreach ($server in (Get-Content D:\Server.txt))
{
Get-XALoadEvaluator -ServerName $server | out-file
-Append D:\LEDetails.txt
Select-String D:\LEDetails.txt -pattern
"LoadEvaluatorName" | out-file -Append D:\LE.txt }
Set-XAServerLoadEvaluator -ServerName $server Offline
}http://blog.virtualyoungtech.com/?p=79
I think above website is of some help, howeverI already have this script but it is not serving my purpose, The script above is rebooting all the servers in the farm, but however, I have a limitation that i can have to finish up rebooting within 3 hours.
3 hours on Sunday: Even numbered servers
3 hours on Monday: Odd numbered servers
Hence I wanted a script which read server list from TEXT file and do the below:
1. Get the LE applied on the servers and export it to TEXT file.
2. Apply the Offline Load Evaluator.
3. See the IDEL session which is more that 1 hour and dissconected session, which should be reset.
4. Send the 3 messages to the users who is active on the server. in 5 min interval.
5. After 10 min, from all 3 messages, reset the sessions and reboot the server.
6. wait for the server to be up, and then re-apply the LE back by checking the text file which we exported in step 1.
Let me know for any clarification.- Edited by natidutt Wednesday, June 27, 2012 8:03 PM
All Replies
-
Wednesday, June 27, 2012 7:32 PMModerator
Hi,
There are multiple <//wbr> tags strewn throughout the text in your post, making it hard to read.
So you have posted a list of requirements you want in a script. Are you asking for someone to code a custom script for you?
If so, please read the following forum posting tips:
http://social.technet.microsoft.com/Forums/en/ITCG/thread/a0def745-4831-4de0-a040-63b63e7be7ae
Bill
-
Wednesday, June 27, 2012 8:11 PM
AbqBill,
Thanks for pointing out, corrected the Tag issue, however, i am not looking for someone to write a script for me :D.
As i am new to powershell, looking for some answers as my Fav search engine not helping with the below :(
3. See the IDEL session which is more that 1 hour and dissconected session, which should be reset.
4. Send the 3 messages to the users who is active on the server. in 5 min interval.
5. After 10 min, from all 3 messages, reset the sessions and reboot the server.
6. wait for the server to be up, and then re-apply the LE back by checking the text file which we exported in step 1.
I already tried to do the things by using some of XenApp commands,However, i am looking for any help to log the output as well.
If its wrong please let me know and also guide me in right direction.
Natesh
-
Wednesday, June 27, 2012 8:12 PM
AbqBill,
Thanks for pointing out, corrected the Tag issue, however, i am not looking for someone to write a script for me :D.
As i am new to powershell, looking for some answers as my Fav search engine not helping with the below :(
3. See the IDEL session which is more that 1 hour and dissconected session, which should be reset.
4. Send the 3 messages to the users who is active on the server. in 5 min interval.
5. After 10 min, from all 3 messages, reset the sessions and reboot the server.
6. wait for the server to be up, and then re-apply the LE back by checking the text file which we exported in step 1.
I already tried to do the things by using some of XenApp commands,However, i am looking for any help to log the output as well.
If its wrong please let me know and also guide me in right direction.
Natesh
-
Wednesday, June 27, 2012 8:36 PMModerator
Hi,
A list of requirements is not a scripting question. It's unlikely a search engine will turn up a script that will meet your exact requirements, so you will need to write the script yourself or hire someone to do it for you.
If you have a specific scripting question, feel free to ask.
Bill- Proposed As Answer by Bill_StewartMicrosoft Community Contributor, Moderator Friday, July 06, 2012 9:18 PM
- Marked As Answer by Richard MuellerMVP, Moderator Saturday, July 28, 2012 6:54 PM

