Posts

Showing posts from June, 2017

Add new HDD using VMware powercli oneliner

Add new HDD get-vm VMName | New-HardDisk -DiskType flat -CapacityGB 2 -StorageFormat EagerZeroedThick -Datastore datastorename

Approving Quarantined ActiveSync Devices with Exchange Management Shell

Get-ActiveSyncDevice -filter {deviceaccessstate -eq 'quarantined'} | select identity, deviceid | fl

clear App-V Cache

Set-ExecutionPolicy RemoteSigned –Force Import-Module AppvClient Get-AppvClientPackage –All | Remove-AppvClientPackage Set-ExecutionPolicy Default –Force

Citrix useful commands

Enable Citrix powershell snap-ins for XenDesktop/XenApp 7.6: Add-PSSnapin Citrix.*.Admin.V* Enable Citrix powershell snap-ins for XenApp 6.5: Add-PSSnapIn citrix.xenapp.commands Add-PSSnapIn citrix.common.Commands Add-PSSnapIn citrix.common.groupPolicy To get a listing of all your XenApp 6.5 servers: get-xaserver | select servername > c:\temp\XenApp_VM_list.txt To get a listing of XenDesktop logged in users: get-brokersession | select UserName > c:\temp\logged_in_users.txt To get a listing of ALL XenDesktop/XenApp 7.6 VMs: get-brokermachine -maxrecordcount 2000 | select machinename > c:\temp\VM_list.txt To send a reboot notification message to a specific desktop group on XenDesktop/XenApp 7.6: Add-PSSnapin citrix* $sessions = Get-BrokerSession -MaxRecordCount 5000 | Where {$_.desktopgroupname -match "Virtual Desktop Group 1"} Send-BrokerSessionMessage $sessions -MessageStyle "Information" -Title "REMINDER: Virtual Desktop Reboot @

improve performance for storefront

To improve performance from a storefront perspective is the ability to maintain a pool of sockets instead of creating a new one each time a new user connects Enable pooled sockets: Open the web.config file under c:\inetpub\wwwroot\citrix\%storename%\ and change pooledSockets to on and do iis reset

“Aw, Snap!” on launch of google chrome in citrix environments

add the following to shortcut of chrome  C:\Program Files (x86)\Google\Chrome\Application\ chrome.exe ” –no-sandbox –disable-infobars –disable-gpu and publish the shortcut through citrix

Disable Power Management completely in Xenapp/Xendesktop

opwn powershell in Studio and run the following Commands Add-PSSnapin *Citrix* Set-BrokerDesktopGroup -Name * -AutomaticPowerOnForAssigned $False Set-BrokerDesktopGroup -Name * -AutomaticPowerOnForAssignedDuringPeak $False Set-BrokerDesktopGroup -Name * -OffPeakBufferSizePercent 0 Set-BrokerDesktopGroup -Name * -PeakBufferSizePercent 0 Set-BrokerDesktopGroup -Name * -ShutdownDesktopsAfterUse $True

Citrix Xenapp when Launching application getting Acess Denied Error

Image
Citrix Xenapp when Launching application getting Acess Denied Error Resolution: On the Affected Xenapp Server create the following Registry Key and Reboot the Server. it will be good practice to implement on all xenapp Servers irrespective of issue HKLM\System\CurrentControlSet\Control\Lsa\Kerberos\Parameters Name: MaxTokenSize Type: REG_DWORD Value: 65535 (Decimal) Ref: https://support.citrix.com/article/CTX136114

“A general system error occurred: No connection could be made because the target machine actively refused it” error when powering on VMs on vCenter Server 6.0

To resolve this issue, start the VMware vCenter workflow manager service. Windows vCenter Server On the server that runs vCenter Server, open Start > Run, type services.msc and press Enter. Right-click VMware vCenter workflow manager service and click start. Attempt to power on the virtual machine again. vCenter Server Appliance (VCSA) Connect to the VCSA shell as root. Run this command to restart the VMware vCenter workflow service ( vmware-vpx-workflow ): # service vmware-vpx-workflow restart Attempt to power on the virtual machine again.

List all VMDK and in which Datastore they are in?

open powercli connect-viserver vcenter@domain.com save the following as VMDK.ps1 $outputFile = "C:\vmdk.csv" $VMsAdv = Get-VM | Sort-Object Name | % { Get-View $_.ID } $myCol = @() ForEach ($VMAdv in $VMsAdv) {     ForEach ($Disk in $VMAdv.Layout.Disk)     {         $myObj = "" | Select-Object Name, Disk         $myObj.Name = $VMAdv.Name         $myObj.Disk = $Disk.DiskFile[0]         $myCol += $myObj     } } $myCol | Export-Csv $outputFile -NoTypeInformation run in powershell

VMware powerCli Commands

Open powercli and connect Vcenter using following command connect-viserver vcenter.domain.com list of VMware Tools get-vm | % { get-view $_.id } | select Name, @{ Name="ToolsVersion"; Expression={$_.config.tools.toolsVersion}},@{ Name="ToolStatus"; Expression={$_.Guest.ToolsVersionStatus}} list of the Vmware tools on each powered on virtual machine get-vm | where {$_.powerstate -ne "PoweredOff" } | % { get-view $_.id } | select Name, @{ Name="ToolsVersion"; Expression={$_.config.tools.toolsVersion}},@{ Name="ToolStatus"; Expression={$_.Guest.ToolsVersionStatus}} list of the Vmware tools that are not up to date on each powered on virtual machine get-vm | where {$_.powerstate -ne "PoweredOff" } | where {$_.Guest.ToolsVersionStatus -ne "guestToolsCurrent"} | % { get-view $_.id } | select Name, @{ Name="ToolsVersion"; Expression={$_.config.tools.toolsVersion}}, @{ Name="ToolStatus"; Expression={$

How to size RAM of Citrix PVS server

The formula to rightsize PVS server memory is as follows  2GB + (No: of XA_vDisk * 4GB) + (no: of XD_vDisk * 2GB) + 15% (Buffer) Example: if i have 2 vdisk for xenapp machines and 4 disks for xendesktop then the calulations will be RAM= 2GB + (2 * 4) + ( 4 * 2GB) + 15% = 2+8+8+ 3 GB(~15%) = 22 GB Note: the Ratio can be reduced if we use PVS acclerator on Xenserver and RAM usage can be monitored by RAMMAP -  RamMap is a great tool for more detailed investigation from Mark Russinovich. PVS is using only physical memory for caching (pagefile is not being used for standby cache) and RamMap gives you perfect details about usage of your RAM.

Delete Mutiple VMs from vCenter using VMware Pwer Cli

Put all the servers to be deleted into  a txt file with your VM’s name one per line. Open PowerCLI Connect on VC: Connect-VIServer –Server “vc@domain.com” put servers.txt in C: drive and run the following command Get-Content c:\servers.txt | foreach { Remove-vm $_ -DeleteFromDisk -Confirm:$false }

Server Manager Error - Server Manager is collecting inventory data. Wizard will be available after data collection finishes

open command prompt with admin rights and execute as below cd C:\Windows\System32\wbem\AutoRecover for /f %s in ('dir /b *.mof *.mfl') do mofcomp %s