jrodsguitar's Posts

I have a script that recomposes pools automatically. It uses some of the VMware.HV.Helper module. Below is a snippet of how I get the pool name, get the master image name, get the location in... See more...
I have a script that recomposes pools automatically. It uses some of the VMware.HV.Helper module. Below is a snippet of how I get the pool name, get the master image name, get the location in vsphere, delete the old parent image, create a new parent image, create a new snapshot for the new parent image, and finally recompose the pool with a new parent image. WARNING: These are just snippets of working code so you'll have to modify alot of this. Don't just try to run this because it won't work without tailoring it to your environment. $PoolName = ((Get-HVPool -HvServer $connect) | where {$_.base.name -notlike 'Persistent*'}) $MASTERIMAGENAME = get-vm -Server $vsphere | where {$_.Name -eq $($MASTERIMAGE)}      $location = Get-folder 'C-Parent-Images' -Server $vsphere                 get-vm -Name "$($CPOOLS)-Parent-$($date)" -Server $vsphere | Remove-VM -DeletePermanently -Server $vsphere -Confirm:$false $parentvm = New-VM -Name "$($CPOOLS)-Parent-$($date)" -VM $MASTERIMAGENAME -Server $vsphere -ResourcePool 'VDI' -Datastore 'VDI - VMS' -Location $location                                                                $NewSnap = New-SnapShot -VM $parentVM -name "$($CPOOLS)-Parent-$($date)" -Server $vsphere do {write-host "snapping..." | out-string; start-sleep -sec 1} until (get-snapshot -vm $parentVM -name "$($CPOOLS)-Parent-$($date)" -ErrorAction SilentlyContinue -Server $vsphere) start-hvpool -Pool $PoolName -Recompose -ParentVM $parentVM -SnapshotVM $newsnap -LogoffSetting FORCE_LOGOFF -HvServer $connect
I wrote a script that does this: https://get-cj.com/2018/07/03/script-to-check-if-a-horizon-vdi-user-is-assigned-to-a-machine/
Try to manually remove the problematic machines using the viewdbck command from one of your connection servers. I've written a simple script you can run from the ISE on the connection serve... See more...
Try to manually remove the problematic machines using the viewdbck command from one of your connection servers. I've written a simple script you can run from the ISE on the connection server. Just add your machines to $vms variable, and change the NAME_OF_VDI_POOL to your exact pool name (Case sensitive) and run the script. A word of Caution: This will disable your pool while it's running. $vms = ( 'MACHINE_NAME', 'MACHINE2_NAME', 'MACHINE3_NAME' ) cd 'C:\Program Files\VMware\VMware View\Server\tools\bin' foreach($vm in $vms){ .\viewdbchk.cmd --removeMachine --desktopName NAME_OF_VDI_POOL --machineName "$($vm)" --noErrorCheck --verbose --force }
I've implemented HA Proxy's with keepalived successfully to load balance several pairs of Connection servers. The only cost it the time required to deploy and learn linux if you don't know it... See more...
I've implemented HA Proxy's with keepalived successfully to load balance several pairs of Connection servers. The only cost it the time required to deploy and learn linux if you don't know it. These HA Proxy have been stable since the day they were deployed. No issues whatsoever. As long as you implement an intelligent health monitor script you'll be fine.
Have you verified that all the correct certs are installed on all the machines? Also have you verified that the Horizon client settings under "Configure SSL"?. If possible I would also try... See more...
Have you verified that all the correct certs are installed on all the machines? Also have you verified that the Horizon client settings under "Configure SSL"?. If possible I would also try to hit your VDI site in a web browser from a machine that is not working correctly to verify if the cert is installed correctly and the site is trusted from that machine.
Honestly this doesn't sound like a horizon client issue. It sounds like a certificate issue. If in the Horizon client on internal clients your server is vdi.cool.local make sure your certific... See more...
Honestly this doesn't sound like a horizon client issue. It sounds like a certificate issue. If in the Horizon client on internal clients your server is vdi.cool.local make sure your certificate reflects this in the subject. If your external cert is vdi.cool.com then make sure the cert reflects that name in the subject. It should also be installed on external clients and signed by a legitimate cert provider (Verisign/GoDaddy/ICANN/etc.) If you use the same cert for internal and external again, make sure the names of the servers are in the subject of the cert (UCC cert for mult-domain cert).
interesting I've never had it fail and I use it to reboot hundred of VM's. Do you see a pattern or a specific status of the machines that are not able to refresh?
If you delete machine manaully. Does it work after that?
Try Secure PCOIP tunnel setting through the UAG. And for external URL setting, set to the external address.
if you create a credential object instead does it work? You will be prompted for a username and password so specify the username as domain\user $cred = get-credential Connect-HVServer CONN... See more...
if you create a credential object instead does it work? You will be prompted for a username and password so specify the username as domain\user $cred = get-credential Connect-HVServer CONN-SERVER_FQDN -Credential $cred
What VMware told me was that by setting these to 0, we are essentially disabling the DDOS protection mechanism on the UAG. Our health monitor from the NetScaler would send a health probe every fe... See more...
What VMware told me was that by setting these to 0, we are essentially disabling the DDOS protection mechanism on the UAG. Our health monitor from the NetScaler would send a health probe every few seconds and eventually the UAG would stop accepting new connections becuause it thought it was being attacked and DDOS'ed. I kept having to reboot the UAG's every so often and this was the root cause. So there maybe a better way to correctly set the health probe to send a connection: close but we didn't have the time and didn't want to risk additional outages.
So if this is purely for POC I would say go ahead and use the older hosts you have. And yes you could just add them to your existing data center then break it out to it's own once you decide to g... See more...
So if this is purely for POC I would say go ahead and use the older hosts you have. And yes you could just add them to your existing data center then break it out to it's own once you decide to go live. I don't think you can go wrong either way as long as you correctly provision the storage and compute resources correctly. Now if you're running thousands and thousands of desktops, of course I recommend to break out to a separate vCenter, but again for a POC, keep it on same the datacenter you are using.
Make sure that you do not specify the domain in the $username variable. So for example if your admin account is 'Administrator', your password is 'cookies',  and your domain name is ' 'catsanddog... See more...
Make sure that you do not specify the domain in the $username variable. So for example if your admin account is 'Administrator', your password is 'cookies',  and your domain name is ' 'catsanddogs' ,you would do it this way: $password = ConvertTo-SecureString 'cookies' -AsPlainText -Force $domain = 'catsanddogs' $username = 'Administrator' $domainuser = $domain + '\' + $username $Cred = New-Object System.Management.Automation.PSCredential ("$domainuser", $password) $machines = ('B-W10-01', 'B-W10-02') Refresh-ViewDesktop -machines $machines -viewserver 'vc.abc.com' -cred $cred
So I treat Connection Servers, Composer Servers, UAG's, and Horizon vCenter as infrastructure. The only things running on my Horizon vSphere are the client machines that users connect to. This is... See more...
So I treat Connection Servers, Composer Servers, UAG's, and Horizon vCenter as infrastructure. The only things running on my Horizon vSphere are the client machines that users connect to. This is really just one way to do it but again, I like to keep my user VDI workstations completely separate from everything else. Excuse the crudity of this mini diagram: Infrastructure vSphere             Infrastructure dataCenter:                     Infrastructure VM Host Cluster (x amount of VM hosts)                               infrastructure vCenter servers                               Horizon vCenter servers (Horizon vSphere)                               Horizon Connection Servers                               Horizon Composer Servers                               Horizon UAG's Horizon vSphere              Horizon dataCenter                        Horizon VM Host Cluster (3 VM hosts)                               Gold Image                               Pool Parent Machines                               Win7-VDI-001                               Win7-VDI-002                               Win7-VDI-003
So I like to keep my infrastructure vCeneter separate from my Horizon vCenter. If I'm recomposing a pool of 1000 linked clones I don't want that to affect or even show up in the infrastructur... See more...
So I like to keep my infrastructure vCeneter separate from my Horizon vCenter. If I'm recomposing a pool of 1000 linked clones I don't want that to affect or even show up in the infrastructure vCenter. I like to keep things separate and not mix it all up. Just my 2 cents.
1. Uploaded the modified script for you to try. I think this should work now for your specific environment. 2. So I do not recommend embedding credentials but if it's what you need I included ... See more...
1. Uploaded the modified script for you to try. I think this should work now for your specific environment. 2. So I do not recommend embedding credentials but if it's what you need I included it as an example. In the updated file you just need to update the domain,username,password and then run the script. Don't forget to mark my answer as correct if all is good  . Thank you.
Might be copy and paste issue. Try copying from attached text file.
When you call the function, run it without the "#". I re-arranged some things so copy this one and try it now: #Script by Jose Rodriguez #https://get-cj.com #Uses ONLY the Horizon View ... See more...
When you call the function, run it without the "#". I re-arranged some things so copy this one and try it now: #Script by Jose Rodriguez #https://get-cj.com #Uses ONLY the Horizon View API to refresh a set of desktops or a single desktop. function refresh-ViewDesktop {   [CmdletBinding()]   [OutputType([PSCustomObject])]     param(                        [string[]]$machines,         [string]$viewserver             ) $cred = Get-Credential $hvServer = Connect-HVServer -server $viewserver -Credential $cred $hvServices = $hvServer.ExtensionData $queryService = New-Object VMware.Hv.QueryServiceService $query = New-Object VMware.Hv.QueryDefinition  $query.queryEntityType = 'MachineNamesView' [VMware.Hv.QueryFilter []] $filters = @() foreach ($machine in $machines){             $filters += new-object VMware.Hv.QueryFilterEquals -property @{'memberName' = 'base.name'; 'value' = $machine} } $orFilter = new-object VMware.Hv.QueryFilterOr -property @{'filters' =  $filters} $query.Filter = $orFilter $queryResults = $queryService.QueryService_Create($hvServices,$query) $finalmachine = @() foreach ($result in $queryResults.Results){     [VMware.Hv.MachineNamesView]$machineNamesView = $result     $properties = @{                        machineid = $machineNamesView.id         names = $machineNamesView.base.name         desktopId = $machineNamesView.base.Desktop                 }     $finalmachine += New-Object -TypeName pscustomobject -Property $properties } $desktopService = New-Object VMware.Hv.DesktopService $machineService = New-Object VMware.Hv.MachineService foreach($object in $finalmachine){     $desktoprefreshSpec = New-Object VMware.Hv.DesktopRefreshSpec     $desktoprefresheSpecHelper = New-Object VMware.Hv.DesktopService+DesktopRefreshSpecHelper     $desktoprefreshSpec.Machines = $object.machineid     $desktoprefreshSpec.LogoffSetting = $desktoprefresheSpecHelper.LOGOFF_SETTING_FORCE_LOGOFF     $desktopService.Desktop_Refresh($hvServices, $machineNamesView.base.Desktop,$desktoprefreshSpec)     Write-Output ""     Write-Output "Refreshing Machines"     $($object.names)     } } And you would run it like this: $machines = ('B-W10-01', 'B-W10-02') Refresh-ViewDesktop -machines $machines -viewserver 'vc.abc.com'
It's a function, so you'll have to run it from within ISE or integrated it into a script. From within ISE you must first run the function, then you should be able to call it with refresh-View... See more...
It's a function, so you'll have to run it from within ISE or integrated it into a script. From within ISE you must first run the function, then you should be able to call it with refresh-ViewDesktop.
I assume that by "reset" you mean what VMware calls a "refresh" in Horizon? Resetting the machine back to when it was first composed right? If so then this PowerCLI function  does exactly what... See more...
I assume that by "reset" you mean what VMware calls a "refresh" in Horizon? Resetting the machine back to when it was first composed right? If so then this PowerCLI function  does exactly what you need: https://get-cj.com/2018/04/02/how-to-refresh-vmware-horizon-desktops-using-powershell-powercli/ Example Usage: $machines = ('machinename1', 'machinename2') Refresh-ViewDesktop -machines $machines -viewserver  'Horizon_Connection_Server'