$srcRemotePC = ‘DomainName\65TELW19’$destRemotePC = ‘DomainName\65TELW20’Get-BrokerUser -PrivateDesktopUid (get-BrokerPrivateDesktop -MachineName $srcRemotePC ).Uid | | %{ if($_.Upn -ne “”) {Add-BrokerUser -Machine $destRemotePC -Name $_.Upn}}
Tag Archives: Powershell
Sign Scripts/EXE’s with Powershell
Note: codesign cert needs to exist under the user’s personal store. TimestampServer is recommended as the script signing would still be honored even the cert that used for signing expires in the future, timestamp server from DigiCert is used as an example, any popular public timestamp server will do.
Publish Outlook 2016 in XenApp
Download Office 2016 Administrative Template files and import ADML and ADMX files to C:\windows\PolicyDefinitions GPO settings below are just a recommendation, Please review and pick ones that apply to you. Computer Configuration/Administrative Templates/Microsoft Office 2016 (Machine)/Updates Enable Automatic Updates > Disable User Configuration/Administrative Templates/Microsoft Office 2016/First Run Disable First Run Movie > Enable Disable Office …
Powershell Snippet – Retrieve Citrix Endpoint Name from WFAPI
[code language=”powershell”] $code = @’ using System; using System.Runtime.InteropServices; namespace WFAPI { public enum WF_INFO_CLASS { WFVersion, // OSVERSIONINFO WFInitialProgram, WFWorkingDirectory, WFOEMId, WFSessionId, WFUserName, WFWinStationName, WFDomainName, WFConnectState, WFClientBuildNumber, WFClientName, WFClientDirectory, WFClientProductId, WFClientHardwareId, WFClientAddress, WFClientDisplay, WFClientCache, WFClientDrives, WFICABufferLength, WFLicenseEnabler, RESERVED2, WFApplicationName, WFVersionEx, WFClientInfo, WFUserInfo, WFAppInfo, WFClientLatency, WFSessionTime, WFLicensingModel } public class Program { [DllImport("wfapi.dll", CharSet=CharSet.Unicode,SetLastError=true)] public …
Continue reading “Powershell Snippet – Retrieve Citrix Endpoint Name from WFAPI”
Running Group policy update on all computers in parallel using powershell
User Case: Made a group policy update and want all the machines to pick up the update. especially in VDI (XenDesktop/View) environment. [code language=”powershell”] $computers = 1..333 | % { "CTX-XD-WIN7" + $_.ToString("000")} Invoke-Command -ComputerName $computers -ScriptBlock {gpupdate /force /target:computer} [/code]
Force Reboot XenDesktop VM's atleast once a day
One of Industry recommendations for PVS streamed machines is to have them reboot once in 24 hrs. This can be achieved with following settings Make sure the default Group Logoff Behavior is set to Shutdown (Default), if not PowerShell Command to Set is Set-BrokerDesktopGroup -Name “DG Name” -ShutdownDesktopsAfterUse $True To find out the current setting …
Continue reading “Force Reboot XenDesktop VM's atleast once a day”