The last couple of weeks I’ve been working with Google Cloud Platform and Citrix Cloud creating a new course coming out very soon. That’s why you’ve seen so many posts lately being all about evergreen download and install scripts.
In the new Citrix Workspace it’s possible to Restart the VM which is okay for VDI, but in a RDSH only environment you would want to remove that option. Now in Citrix Cloud there’s now GUI to do this hence the reason for using Remote PowerShell SDK for Citrix Cloud.
First you’ll need to install Remote PowerShell SDK which is done automatically by running my script below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# PowerShell Wrapper for MDT, Standalone and Chocolatey Installation - (C)2015 xenappblog.com # Example 1: Start-Process "XenDesktopServerSetup.exe" -ArgumentList $unattendedArgs -Wait -Passthru # Example 2 Powershell: Start-Process powershell.exe -ExecutionPolicy bypass -file $Destination # Example 3 EXE (Always use ' '): # $UnattendedArgs='/qn' # (Start-Process "$PackageName.$InstallerType" $UnattendedArgs -Wait -Passthru).ExitCode # Example 4 MSI (Always use " "): # $UnattendedArgs = "/i $PackageName.$InstallerType ALLUSERS=1 /qn /liewa $LogApp" # (Start-Process msiexec.exe -ArgumentList $UnattendedArgs -Wait -Passthru).ExitCode Clear-Host Write-Verbose "Setting Arguments" -Verbose $StartDTM = (Get-Date) $Vendor = "Citrix" $Product = "Virtual Apps and Desktops Remote PowerShell SDK" $Version = "7.19.0.26" $PackageName = "CitrixPoshSdk" $InstallerType = "exe" $Source = "$PackageName" + "." + "$InstallerType" $LogPS = "${env:SystemRoot}" + "\Temp\$Vendor $Product $Version PS Wrapper.log" $LogApp = "${env:SystemRoot}" + "\Temp\$PackageName.log" $Destination = "${env:ChocoRepository}" + "\$Vendor\$Product\$Version\$packageName.$installerType" $UnattendedArgs='/q' $url = "https://download.apps.cloud.com/CitrixPoshSdk.exe" $ProgressPreference = 'SilentlyContinue' Start-Transcript $LogPS if( -Not (Test-Path -Path $Version ) ) { New-Item -ItemType directory -Path $Version } CD $Version Write-Verbose "Downloading $Vendor $Product $Version" -Verbose If (!(Test-Path -Path $Source)) { Invoke-WebRequest -Uri $url -OutFile $Source } Else { Write-Verbose "File exists. Skipping Download." -Verbose } Write-Verbose "Starting Installation of $Vendor $Product $Version" -Verbose (Start-Process "$PackageName.$InstallerType" $UnattendedArgs -Wait -Passthru).ExitCode Write-Verbose "Customization" -Verbose Write-Verbose "Stop logging" -Verbose $EndDTM = (Get-Date) Write-Verbose "Elapsed Time: $(($EndDTM-$StartDTM).TotalSeconds) Seconds" -Verbose Write-Verbose "Elapsed Time: $(($EndDTM-$StartDTM).TotalMinutes) Minutes" -Verbose Stop-Transcript |
Then we need to load the modules and authenticate.
1 2 |
Asnp Citrix* get-Xdauthentication |
This will bring up the Citrix Cloud logon form.
Then just replace DeliveryGroupName in the script below and run it.
1 |
Get-BrokerAccessPolicyRule -filter { DesktopGroupName -eq "DeliveryGroupName" } | Set-BrokerAccessPolicyRule -AllowRestart $false |
Why would you want to remove that? It’s a common missunderstnading that Restart means reastarting the actual machine – not true. I think Citrix uses the term Restart because end users understand that they should press on that button if they have issues within the session. What actually happens is just that the session is reset within the RDSH VM.