This is the first post in a series of shorts that I will be posting about various methods that you can use with the VMware Horizon API’s. This time it will be about resetting desktops. When looking at the API Explorer you’ll see that there are two ways do do this from the machine service.
So the first is for a single VDI desktop and the latter for multiple.
First we need to get a list of vm’s I will be using the machines in pod1pool02 as victims for this post.
If you have used the VMware.hv.helper the title of this blog post might sound strange since the set-hvmachine already has a way to set maintenance mode. When Ryan Butler asked me the question this week though I didn’t think of that and dived into the api’s immediately. The machines.Machine_EnterMaintenanceMode method looked good to me and than I though of the vmware.hv.helper and noticed that with
Set-HVMachine -Maintenance ENTER_MAINTENANCE_MODE
it was also possible so set maintenance mode. The usage though made me think immediately that this was not actually using a proper api call but the update function. A quick look at the function itself confirmed this. It sets that status of the virtual machine by directly setting the status.
If you are below version 7.5 of Horizon view it’s probably of no use to continue with the rest of this blog post. The api explorer only mentions the relevant functions since 7.5! They have been tried against 7.0.3 and 6.2 and there they don’t work.
So back to the drawing board it was and I needed to look at the API explorer, there are 4 relevant methods for maintenance mode.
As usual there are methods for multiple machines that use an array of id’s (with machines in the name) and methods for single machines id’s (without the machines in the name).
Since I usually use instant clones these days I created a small pool with three linked clones. With get-hvmachine I can show you their names and state.
Okay so we now know how this works but I don’t want to use to vmware.hv.helper module for this at all because I want to be able to use a list of machines or based on part of the name. That can be done using a query. The query entitytype to use is MachineSummaryView and if you use queryfiltercontains it’s also possible to use only a part of the name for a kind of wildcard selection. Combine several of these in with queryfilteror and it gives the opportunity to select them from a list.
So this is the second post in this series about the Horizon View API basics. While functions logically would be part 2 I have decided on doing queries first since you might need the result for a query before you can use some of the functions. Some if it will seem double from my recent post about pulling event information but not everyone might be looking into that. This post will not have as much gifs as the first post but that’s because only the end results count for this one.
Looking at the API Explorer these are the services that we can actually query:
There are some examples in the API explorer but will show you some different examples with the aduserorgroupsummaryview since that one has a lot of documented filters and I can easily add some extra accounts to show different queries.
The first thing that we always need to do with queries is to declare the queryservice object
If you do a get-method on this object it will show several possible methods to use.
The next thing to do is to create a definition object in which we will declare the things the query looks for.
$defn = New-Object VMware.Hv.QueryDefinition
When getting this object and its get-method it shows the definitions we can set, as you can see all method’s are already visible from just viewing the object so we don’t need to use the get-method anymore.
Now we need to set a QueryEntityType these can be found in the API explorer under the Queryable Entity Types. They have to be used between quotation marks.
Now we’re already set to create some results by putting the query into an object.
This way it’s also easy to count the amount of returned objects. This is very useful if you have a bigger environment and want to take counts of sessions with their status (i.e. Connected, disconnected, error etc)
Next up is adding a filter, so we only get user accounts but we need to do some maintenance first. If you do too many queries it is possible that you will get some errors about too many filters or something (of course I am not getting them while writing this post) so, it might be needed to remove the old stored queries is possible with the queryservice_deleteall method.
This does not give any feedback on the results so let’s continue with the old query and put a filter on it. First you need to know what kind of filter you need and the options are listed in the API explorer.
The first one I will use is queryfilterequals since I use that the most. I start by defining a filter object consisting of a property with a value.
Now I will show you the results + the fact that you don’t necessarily need to define an object for the results. I have selected the first result to show you that it contains the domain administrator account
It is also possible to combine several filters into one query, while the ad service might not be the most useful for this it can still be used as an example. The thing to do is to first create a couple of filters.
Please be aware that these membernames are case sensitive!
That’s it for the basics of doing queries using the Horizon View API’s. There are some more things that we can do with these like sorting them, but I think you can find that on your own in the API explorer examples.
Update 15-10: I have received an overview from VMware about the other changes:
New API Endpoints:
There also have been some changes to some objects (MachineBase,AccessGroup etc) to include more properties
Today the latest version of PowerCLI was released with version 11.0.0. When you look at the release notes it’s obvious that some extra things have been added for the Horizon VIew API’s.
PowerCLI has been moving at quite the rapid pace over the last 2 years. In 2018, we’ve been releasing roughly every other month to make sure we get the latest features, performance improvements, and updates available as quickly as possible. Well, it’s been two months and we’re not going to break this trend. Today, we are releasing PowerCLI 11.0.0!
PowerCLI 11.0.0 comes with the following updates:
Added a new Security module
Added new cmdlets for Host Profiles
Added a new cmdlet to interact with NSX-T in VMware Cloud on AWS
Support for vSphere 6.7 Update 1
Support for NSX-T 2.3
Support for Horizon View 7.6
Support for vCloud Director 9.5
Multiplatform support for the Cloud module
Updated the Get-ErrorReport cmdlet
Removed the PCloud module
Removed the HA module
Even though Jake Robinson already gave me a heads up that this version was coming it’s always the question what has been added for Horizon View. According to the API explorer page no new querydefinitions have been added. Like last time I decided to compare the services against the old list and there are two new additions:
I have tried both against a Horizon 7.5 setup and they failed so these are only exposed from Horizon View 7.6 and up.
The first one called Categoryfolder is linked to the possibility to put rdsh applications into folders.
It currently has only one function:
I have also investigated if there was a way to change things using the helper function but sadly it has no .update api call so that’s a no-go. I currently have no rdsh on my lab so I can do the list but it doesn’t show anything.
The other new service is the .ResourceSettings just like categoryfolder it also only has one function:
For this one I can actually show what it’s used for:
It shows the general settings for forced logoffs.
Sadly this service also doesn’t show a way to change things.
Sadly I have no found no way yet to see what queryservice entity’s have been added so hopefully we will have a new API explorer soon (maybe with release notes this time, pretty please VMware?) that shows us all the new goods.
VMware Horizon Session Recording allows administrators of a VMware Horizon environment record their users activity in their Blast Extreme virtual desktop and application sessions.
With Session Recording, the administrator can choose to record local or remote sessions, to a central recording Server where the administrator can watch the recordings back via a HTML 5 web console integrated into the server.
The Session Recordings are stored as MP4 files for watching via the web console or downloading to play in a local player.
The VMware Horizon Session Recording Fling comprises of two components:
A Central Recording Repository + Web Front End
The Agent to be installed in the virtual desktop or RDSH host template which facilitates the recording.
Today VMware Horizon Session Recording supports Windows Server 2016 as the Central Server along with Windows 7, 10, Server 2012 and Server 2016 on the agent.
The DRS Dump Insight H5 Plugin helps answer simple questions like
“Can I get all the recommendations made by DRS?”
“Why did DRS make a certain recommendation?”
“Why is DRS not making any recommendations to balance my cluster?”
“How is my custom affinity/anti-affinity rule affecting load balancing in my cluster?”
“If I have a policy defined in my cluster, how different would DRS load balancing be?”
When diagnosing Distributed Resource Scheduler (DRS) cluster issues in vSphere, we look at vCenter server logs from the support bundle, including DrmDump files to find any clues. Analyzing DrmDumps is a slow and tedious process, is usually done by VMware support or Engineering teams for advanced debugging of algorithm related issues. This is because analyzing the dumps requires building a replayer module, for which one needs access to the source code. Another challenge is that the final DrmDump data is not in plain text format; it requires someone with an understanding of the source code to be able to make good sense of it.
There is an existing DRS Dump Insight fling, which can replay DrmDumps and provide useful information for debugging. However, Dump Insight requires users to manually upload relevant DrmDump files from the time when the issue occurred. With the DRS Dump Insight H5 Plugin, customers do not need to upload any DrmDump files, and can access all the anal yzed information from their vSphere HTML5 web client itself.
Once a customer installs the HTML5 plugin, a new DRS Dump Insight tab will be available under the “cluster -> monitor” view.
All the DrmDump files that are available for the given cluster are listed in the opening screen. Customers can select the dump file of their choice for analysis.
They can also select multiple dump files to be analyzed together.
After analysis, the tool shows the analysis for each dump file in a separate tab view.
The Workspace ONE Configuration Tool helps you build special-purpose unattend.xml configuration files to be applied in the Dell factory as part of Factory Provisioning. This helps to domain join (domain, workgroup, AAD, AAD Premium) and enroll devices automatically on first-boot. This simplifies the creation of the unattend.xml configuration file for Windows 10.
It’s a stand-alone .exe app that helps IT administrators configure general and Out-of-the-Box Experience Windows setups to automatically enroll users in Workspace ONE.
The User Interface is made simple with explicit instructions about each field for easy and quick use by IT admins.
The User Interface has dynamic and efficient validations in Clarity and Angular, preventing the user from building the unattend.xml until all the validations are correctly satisfied.
This makes the UI fool-proof and reduces the chances of generating an invalid xml file.
The tool is made as a .Net Core 2.0 web app with Angular 5 and Clarity, which eases the integration of v2.0 into the AirWatch Console.
The policy builder is an hosted fling that helps the user to create custom MDM policies for Workspace UEM (former Airwatch)
This cloud hosted Fling helps users with custom Mobile Device Management (MDM) policy generation that use MDM capabilities available through Microsoft’s Windows 10 MDM Configuration Service Providers (CSPs).
Note: On login with My VMmware credentials, the tool provides an easy to use form based UI that allows the Windows 10 admin to simply enter the required values for the policies and auto generates corresponding syncML that can be copied to publish through Workspace ONE Unified Endpoint Management.
This tool greatly reduces the effort of hand rolling syncML and the possibility of code and formatting errors when creating or managing custom settings profiles through Workspace ONE UEM.
[sta_anchor id=”sddccert” /]
SDDC Certificate Tool
The SDDC Certificate Tool is an automated process that replaces all certificates in a SDDC for you. This normally can be a lengthy process but should be a breeze with this fling.
Replacing SSL certificates across VMware products is a manual and time-consuming process. The SDDC Certificate Tool automates this workflow and makes it easy to keep certificates across your SDDC up to date. It will replace all certificates in the supported products and reestablish trust between the components.
Not my cup of tea but this fling is supposed to be an example where you can talk against vRealize Automation.
vAssist.ai, a Natural Language Processing (NLP) platform, enables bot developers to train machine learning models for intent classification and entity extraction. This platform is available as a SaaS model which exposes easy-to-use REST APIs to train and parse natural language inputs. It also provides a multi-tenant user interface dashboard which can be used to annotate and visualize training data expressions and train machine learning models in the cloud.
VMware customers who are serious about building conversational interfaces can benefit from this platform. With this Fling we trained a sample model for vRealize Automation. Users can chat with the test bot to query available catalog services and initiate a provisioning request in a natural, conversational way. Please note that we are using a sample internal environment for vRealize Automation.
NLU Engine for Intent and entity extraction
Customizable NLU pipeline
Rule based and ML based Conversation Engine
Privacy of the data
Scalable and Fault Tolerant
REST APIs exposed for integration with multiple channels and platforms
The Workspace ONE UEM Samsung E-FOTA Tool is designed to add to the existing abilities of AirWatch’s Samsung E-FOTA implementation. These new abilities include scheduling a firmware/OS update in a targeted window. This feature is dependent on the existing abilities within AirWatch which enroll the MDM into Samsung E-FOTA and push profiles to enroll the device into Samsung E-FOTA. Users should use this tool along with the information gathered from the Workspace ONE UEM console. The information can then be used to make an API command to schedule the firmware/OS update to your Samsung devices.
[sta_anchor id=”horhelpdesk” /]
Horizon Helpdesk Utility
Like I said yesterday the Horizon Helpdesk Utility is how the original Horizon View Helpdesk Tool should have been. Please read yesterdays;s post for more information and screenshots.
The Horizon Helpdesk Utility is designed to be a tool used by real help desk agents. The Horizon Helpdesk Utility takes all of the functionality of the current HTML5 based Helpdesk in VMware Horizon and adds true desktop integration features, including:
Greater speed in queries
Reduced steps to find a session
Multiple monitoring windows
Keystrokes for fast access
Native remote control functionality
Built-in session experience score based on session performance and variables
[sta_anchor id=”osot” /]
VMware OS Optimization Tool
July 30, 2018, b1100
Issue fix: With group selection operation, unselected optimization items are applied.
Ok, normally I do a post each month with the latest and greatest flings and I will still do that tomorrow. Today though Andrew Morgan from VMware OCTO has released a fantastic new fling: Horizon Helpdesk Utility! But we already have the Helpdesk tool you might say? Well this fling is everything the helpdesk tool should have been. While it isn’t bad this one is way better.
First of all this fling is an app that you need to install on your own computer or a management server. It will keep its settings in C:\Users\Username\AppData\Roaming\HorizonHelpDeskAgent\ .net Framework 4.5.2 is required but most will already have that or a higher version installed. Installation itself is a quick next next finish with the warning that the signer of the application is not trusted, I have been told that this might be fixed in the next release. After installation you will find a new application in your start menu. I have already attached it to my start menu as well.
After starting you will get a box where you will need to fill in the server address including the http part and your credentials (the same role is required as the regular helpdesk tool)
If you don’t have a trusted certificate you will get a box to accept that certificate.
After that I was looking for something to popup but I just had a small icon added down right
Right click on this and you’ll see a small search box. This search is more easily reachable by using ctrl+F12
Put in a name and you’ll get a box that contains all matching names
Double click the correct account or session and the real deal will open up for you.
The diagrams hardly need any explanation, please also notice the user experience rating on the top right. The image in my lab doesn’t have anything installed so I can’t really show a lot but here are the views from the other tabs as well:
All entitlements for the user
This is pulled directly from the event database
Some more fancy diagrams about the blast protocol
The last tab shows all processes on the desktop, this can easily be filtered on any of the info shown
A possible improvement here would be some kind of checkbox to show only the users own processes because otherwise things can get confusing at RDS hosts. I’ve already talked with Andrew about that (actually the checkbox was his idea).
On the top left there’s a couple of pull down menus to allow for some actions on the session or the machine itself.
The remote control functionality starts windows’ own mrsa tool.
Despite running it against my own very small lab the tool seems to perform very well. I consider it for the few moments that I have used it as a very decent replacement for the original helpdesk tool.
Yesterday it was clear for me that more people are interested in what Dutch secret agents have to do with airwatch/workspace one uem then with PowerCLi for Horizon View. Nonetheless there where some people listening to my presentation and watching the ginormous slide deck filled with gif’s that I created. My personal experience was that it went ok but nothing more than that. Sadly using the vga cable didn’t help against the connection bugs all presenters where having during the entire day. Also I would have preferred to have a monitor in front of me so I could actually hear myself talking in that big room. Personal points for next time: I had a good storyline in my head in advance, that didn’t come out at all. Also I need to channel my personal energy onto stage, I have the feeling that wasn’t really visible. Aka I need to do some more energetic storytelling.
For the people interesting in the presentation it can be found HERE. There’s a video recorded that I will add to this post when it gets published. Luckily there where also a couple of tweets about my sessions so we do already have some pictures.
VMware quietly released a new version of PowerCLI last week: 10.1.1. This release is mainly an update for the Horizon View API’s. This to bring it back on level with the current Horizon release at 7.5. The release notes are not very extensive but it has a fix for some people getting time-outs when connecting to a Connection server plus a bunch of new api calls.
I have dumped the output from the available api calls into two text files and made a comparison:
Since there’s no update yet in the API explorer I will have to make an educated guess on what the functions do:
When looking at the available method’s for this call it looks like it has everything to do with Desktop task. But it also can’t do a damn thing without an vmware.hv.desktoptaskid. This will most probably bu retrievable using a query. This is something I will further investigate in the future.
To be honest I have no idea yet what this one does. I have tried created a VMware.Hv.DiagOperationRequest and tried to send it but got an error that no message queue handler was found. This might be something from Horizon 7.5 since I haven’t updated my lab yet.
This one is easy, it creates, deletes, gets and lists remote access users. You can expect a function for this in the near future since it looks easy to build.
According to my sources this is a SSO token between the flex and html5 clients.
This obviously is created to pull logon timing as the name suggests. I have put a session ID in a variable but sadly the data is not usable from PowerCLI. WHat it seems to be is the api call the Helpdesk client uses to pull the logon time. I didn’t have the timing profiler turned on initially and neither the helpdesk tool or this call gave my any information. Disconnected sessions also don’t give any information and when reconnected it gives the reconnection time not the initial logontime for when the session started. This is the same behaviour as the helpdesk tool.
Apparently the output is in a json format and for now I doubt if it will be usable in a function.
While the session itself has this information.
No idea yet why there is a networkproxy configuration in here.
This gets some performance data using a session id as also visible in the helpdesk tool.
Gives per session information on the Skype 4 Business pairing mode.
100% sure related to the remote assistance function in the helpdesk tool.
Looks like this one gets some information from a query and then kills the process, will have to dig into it some further later on. This for sure is a function in the helpdesk tool.
Again from the helpdesktool, this gives the client version of a session.
For now I only see the DesktopTask and GatewayAccessUserOrGroup ending up in a function in the vmware.hv.helper. The first one will need some digging on how it exactly works but it has the looks of a usable call. The latter on can be in there pretty fast if I find the time to do so. The other ones
Already received some extra information about some calls.