XenApp and XenDesktop 7.x Server OS VDA Offset Reboot

3:35 PM
XenApp and XenDesktop 7.x Server OS VDA Offset Reboot -

I came execute recently graduated in a request restarts for XenDesktop 7.6 Server OS VDAS.

Since most you could know 7.x we rationalized with XenApp and XenDesktop, the core product architecture to FlexCast Management Architecture (FMA). While FMA us with basic skills has to perform automatic restarts, there are scenarios that have more flexible mechanisms and timetables.

I have such a requirement recently came perform staggered restart of Remote Desktop Session Hosts (RDSH), also known as Server OS VDAS known. While there there are some pretty good scripts, I finally decided that my own solution, because none of the scripts to create my customers were all the requirements had Addressing.

One of the solutions is a script written by my colleague is Miguel Contreras, which can be found here. But I thought it might be worth as to share with you my script

So, first some information about the requirements .:

  • not a single instance perform the restart. Thus it is not the creation restart plans to the controller.
  • to create as much flexibility restart groups, as required. For example, perform restart a particular machine catalog over a whole week, for a single machine catalog in seven restart Group result has.
  • configuration of the restart schedule through Active Directory and Group Policy mechanisms.
  • Selection of whether the users are forced before rebooting to logout, or if the restart is delayed until the last user disconnects.
  • No response to the server naming scheme.
  • Support for Windows Server 08 R2 and Windows Server 2012 R2.
  • Disable application for new sessions but allow to exist again.
  • send messages to restart the existing sessions.
  • Configure passed the delays (restart messages, log off and reboot) via the parameters to the script.
  • Make sure all the servers of a particular group does not restart at the same time.

The script is aimed at all of the above requirements. First of all, the RDS login mode on servers, which is scheduled for a reboot to discharged until it is restarted. This ensures that no new session is initiated, but can connect users to existing sessions. Through a configurable delay the existing sessions periodic messages do users get to learn about the upcoming reboot. Depending on the configuration, the user logoff is forced cycle time after rebooting, or the user will receive a message until the last session will be logged, depending on your requirements. After the last user is logged off, the server will perform the restart. To ensure that each server is restarted at a different time within the restart cycle, a random value is generated and the delay before the script is used to start with the reboot tasks.

to want to deploy the script to VDAS, I prefer to Group Policy settings (GPP). This ensures that each VDA loads the current version of the script from a central share. The task scheduler is configured as well as by GPP. By the use of the targeting mechanism of GPP, it is possible to use a single GPO to assign different schedules of VDAs. The cool thing about targeting is that it is very flexible. You can use organizational units (OU) or Active Directory security groups, for example, assign the correct directions to a server group

. Note:
There is currently a limitation of this script. Since each VDA is to reboot on its own, the controller is not involved. So Machine Creation Services (MCS) manages VDAS not their cache disk reset, the hypervisor will not receive any instructions to do so. This results in supporting the Provisioning Services (PVS) and 3 rd party tools managed VDAS for this script. Maybe I'll make an updated version available MCS as to support later.

Another thing to mention that Microsoft Windows Server 08 R2 provides PowerShell cmdlets for RDS available, so I use the "Terminal Services Module" from. CodePlex

But now, let's take a look at how to implement the solution .:

  1. make a share on the script set to
    I assume I need not tell you how 😉
  2. [1945006create] a GPP record the script on any of your VDAS.
    GPP is to modify a large and flexible solution for your environment.
    I deploy personally prefer GPP via login scripts. So I use it for this solution and
    Search "files" under Computer Configuration .:
    01
    Build. An "update" or "replace" action for the script file Enter to copy your central share and the local folder the script: 01
  3. Create a task scheduler for each of your server groups by GPP
    Also, this could also be scripted. But I'm going back to my favorite mechanism using
    Looking the "Scheduled Tasks" under Computer Configuration .:
    03
    Build a "scheduled tasks (At least Windows 7)" for each of the required reboot groups ( eg Monday to Sunday):
    04
    to the required information:
    05

    an account with the appropriate permissions Enter to restart the server:
    "NT AUTHORITY system Set "

    , the appropriate trigger for each scheduled task:
    06

    Set the action for each scheduled task:
    07

    example action without forced logoff:
    powershell.exe -ExecutionPolicy RemoteSigned file "C: tools RebootSchedule ServerVDAReboot.ps1" -MsgDelay 0 -RebootDelay 300 -ForceLogoff 0

    example action with forced logoff:
    powershell.exe -ExecutionPolicy RemoteSigned file "C: tools RebootSchedule ServerVDAReboot.ps1" -RebootCycle 30 -MsgDelay 0 -LogoffDelay 300 -RebootDelay 300 -ForceLogoff 1

    -RebootCycle = 30
    Disable registration 1 hour before the reboot process (only if ForceLogoff = 1)
    -MsgDelay = 0
    users send messages every 10 minutes
    -LogoffDelay = 300
    force users sent logout 5 minutes after the last message (not relevant if ForceLogoff = 0)
    - RebootDelay = 300
    logged reboot VDA 5 minutes after the last user
    -ForceLogoff = 0
    no logout is forced to start only when no user session on VDA

    Note:
    For Windows Server 08 R2, enter the 32-bit "powershell.exe" (because of the terminal Services module from CodePlex):
    "C : Windows SysWOW64 Windows v1.0 powershell.exe "

    For Windows Server 2012 R2, enter the 64-bit" powershell.exe ":
    " C : windows system32 Windows v1.0 powershell.exe "

    to the element level set for each scheduled task targeting:
    08

    Either based on OU structure of Active Directory
    09

    This of course requires appropriate OU design - for example: Or
    10

    based on Active Directory security groups:
    11
    Enter the corresponding Active Directory security group.

it is. Your VDAS be configured to restart schedule, after the GPO is applied. When you add new equipment to your environment, they simply put in the appropriate OU or make them a member of the desired Active Directory Security Group

Last, but not least, to fulfill the legal guys .:

Disclaimer

This software / sample code is provided to you without representations, warranties or conditions of any kind "as is". You can use, modify and distribute it at your own risk. CITRIX DISCLAIMS ALL WARRANTIES OF ANY KIND, EXPRESS, IMPLIED, WRITTEN, ORAL OR STATUTORY, INCLUDING WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.

Without limiting the generality of the foregoing, you acknowledge and agree that (a) may have the software / sample code errors, design flaws or other problems that may cause data loss or damage to property; (B) it may not be possible to make the software / sample code fully functional; and (c) Citrix may, without notice or liability to you, no longer available to make the current version and / or future versions of the software / sample code. In no case the software / code to support ultra-hazardous activities should be used, including, but not support for life or explosives limited activities.

NEITHER CITRIX NOR ITS AFFILIATES OR AGENTS UNDER CONTRACT BE LIABLE, OR OTHER THEORY OF LIABILITY FOR DAMAGES BY USING THE SOFTWARE / SAMPLE CODE, INCLUDING DIRECT, SPECIAL, CONSEQUENTIAL OR OTHER DAMAGES, WHETHER SUCH DAMAGES THE POSSIBILITY.

Although the copyright in the software / code belongs to Citrix, should any distribution of the code are only your own standard of the owner of the rights, and not by Citrix. You agree to indemnify and defend Citrix against any claims arising from the use, modification or distribution of the code created.

The script can be downloaded here.

Hope this could be useful for you also

UPDATE: ..! New version with some code cosmetic and bug fixing

Until next time

Robert Woelfer
Principal Consultant | Citrix Consulting Central and Eastern Europe

Previous
Next Post »
0 Komentar