jrodsguitar's Accepted Solutions

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
For that just change this line: $entitledusers = (Get-ADGroupMember $Poolentitlments.distinguishedName).count To this: $entitledusers = ($PoolEntitlments | foreach {Get-ADGroupMember $... See more...
For that just change this line: $entitledusers = (Get-ADGroupMember $Poolentitlments.distinguishedName).count To this: $entitledusers = ($PoolEntitlments | foreach {Get-ADGroupMember $_.distinguishedName | where {$_.objectclass -eq 'user'}}).count if I've been helpful please mark my answer as Correct
Delete the machine. It should recreate it if it's an automated pool with provision all up front set.
Right this is my biggest problem with the UAG's. You can't just reboot the UAG's and have them magically move the users that are connecting through them to other UAG's. It's almost a poor man'... See more...
Right this is my biggest problem with the UAG's. You can't just reboot the UAG's and have them magically move the users that are connecting through them to other UAG's. It's almost a poor man's solution (For a very expensive product) but you have to use Quiesce mode on the UAG (Or disable in the load balancer) to drain the UAG's. Then once all users are off the UAG you can reboot it. I suggested a solution that will auto move sessions to another UAG for a truly seamless experience while performing maintenance etc. Hopefully VMWare one day engineers such a solution.
*Updated the script slightly.* https://get-cj.com/2018/04/02/how-to-refresh-vmware-horizon-desktops-using-powershell-powercli/ I was inspired by pegduffy​ after you posted that snippet of c... See more...
*Updated the script slightly.* https://get-cj.com/2018/04/02/how-to-refresh-vmware-horizon-desktops-using-powershell-powercli/ I was inspired by pegduffy​ after you posted that snippet of code. I wrote a new function that refreshes a desktop or a list of desktops. Much of the reference for this comes from the various VMWare sites and Horizon API reference pages. Please post your solution as well when you find it. If you want   It's good to see the way others do it. Good learning experience. Example: $machines = ('machinename1', 'machinename2') refresh-ViewDesktop -machines $machines -viewserver  'Horizon_Connection_Server' 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     $desktoprefreshSpec.StartTime = $null     $desktopService.Desktop_Refresh($hvServices, $machineNamesView.base.Desktop,$desktoprefreshSpec)     Write-Output ""     Write-Output "Refreshing Machines"     $($object.names)     } } Disclaimer: ~I'm just an IT enthusiast with no certs, no degrees, no training, in any of this crap, but I know my way around google so that's all that matters. -Jose Rodriguez~
I greatly dislike when I find a forum post with no answer so I will answer what the final solution to this was. I had done some digging into the UAG console and noticed the below messages. Fro... See more...
I greatly dislike when I find a forum post with no answer so I will answer what the final solution to this was. I had done some digging into the UAG console and noticed the below messages. From what I had gathered the UAG has a built in mechanism that protects itself from DDOS type attacks. Our Citrix Netscaler Load Balancer health check was triggering this mechanism. So essentially the UAG thought the Load Balancer was attacking it so it shut itself down. The DosPreventionHandler kicked in. Port 4172 (PCOIP) remained open, existing users remained connected, but port 443 stopped accepting new connection. When I spoke to VMWare support they confirmed my suspicion. The workaround is to set the below settings to 0 in the UAG.