WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple
You are here: Home / ESXi / Blocking vSphere C# Client Logins

Blocking vSphere C# Client Logins

12.10.2012 by William Lam // 8 Comments

I recently picked up on this neat little tidbit from Mr. Not Supported aka Randy Keener, where you can block a user from logging into the vCenter Server using the vSphere C# Client. Other than playing a prank on your co-workers, you might be wondering is there a use case for this? Surprisingly, this is a request I have heard from a few customers in the past where they would like to block their users from using the vSphere C# Client in favor of leveraging only the vSphere APIs for routine tasks.

Since the vSphere C# Client also uses the vSphere API itself, a user with proper credentials to the vSphere environment can easily download the client from an alternative source and still login. Of course, there are ways of preventing this such as restricting application installation on end users desktop but there is some amount of management overhead of identifying those existing and new users, especially if access is delegated out to other teams.

There is a very simple solution if you choose to block ALL users from using the vSphere C# Client which requires a tiny modification on the vCenter Server itself and it takes effect immediately with no service restarts.

Disclaimer: This is probably not officially supported by VMware, use at your own risk.

Login to your vCenter Server and locate a file called version.txt

Windows: C:\ProgramData\VMware\VMware VirtualCenter\docRoot\client
VCSA: /etc/vmware-vpx/docRoot/client

There is parameter called exactVersion which will be set to current supported version of the vSphere C# Client which should also match the version of your vCenter Server. You just need to change this to some other value that you know will not exist in your environment such as 9.0.0. Once you have made this change, now when a user tries to connect and there is a miss-match in the version, the vCenter Server will provide you with a download to the vSphere C# Client located on the server as it normally would if you did not have the latest client.

What the user will find out shortly, is that this will continue in an infinite loop even after installing the proper vSphere C# Client. The reason for this is that the number in version.txt will never match the vSphere C# Client and vCenter Server will just continue serving the installer in an infinite loop. I also looked into this trick for a standalone ESXi host and you can do the same by editing a file called clients.xml which is located in /usr/lib/vmware/hostd/docroot/client and users will not be able to login to the ESXi host using the vSphere C# Client.

Now, even though this prevents users from logging into the vSphere C# Client, users will still be able to connect using the vSphere API which includes the use of vCLI/ESXCLI, PowerCLI, vCO, SDKs, etc. and the use of the vSphere Web Client for either vSphere 5.0 or 5.1 will continue to work. Ideally, it would be nice to be able to control this access on a per user/group basis and perhaps even specify how a user can connect whether that is through the use of the APIs or UI only. Is this even useful to have at all? Would love to hear your comments.

For now, if you want users to get familiar with the new vSphere Web Client 5.1 ... this is one way of "encouraging" them 😉

More from my site

  • PowerCLI script to help correlate vCenter, ESXi & vSAN build/versions w/o manual VMware KB lookup
  • Using the vSphere API to remotely collect ESXi esxcfg-info
  • Quick Tip - Changing default port for HTTP Reverse Proxy on both vCenter Server & ESXi
  • Edit Virtual Hardware 10 VMs using vSphere 5.5 Update 2 C# Client
  • You no longer can install vSphere C# Client on Windows Domain Controller in vSphere 5.5

Categories // ESXi, vSphere Tags // ESXi, vCenter Server, vsphere C# client, vsphere client

Comments

  1. *protectedAnonymous says

    12/11/2012 at 7:50 am

    I would love to be able to limit access to only UI. I can't wait for the day someone's terrible powercli script sens vcenter into a tail spin

    Reply
  2. *protectedviz says

    12/11/2012 at 6:17 pm

    Hi Liam
    Is there a way to restrict access to vSphere client (C# and Web) to certain IP addresses?

    Reply
    • *protectedWilliam says

      12/17/2012 at 8:24 pm

      No there is not. You could setup ACL (access control lists) and firewall rules on certain IP Addresses/ranges, but there is nothing built into the system that allows you to do that. This is just general network/security settings that you would apply based on your organizations requirements.

      Reply
  3. *protectedpravin utekar says

    05/30/2013 at 7:13 pm

    hi but what about those who should be able acces the vcenter supp[ose the admin. is he able to login. please suggest thanks

    Reply

Trackbacks

  1. Newsletter: January 17, 2015 | Notes from MWhite says:
    01/17/2016 at 3:15 pm

    […] Blocking vSphere C# Client Logins This could be a fun trick to share with your co-workers!  Blocking vSphere 6 C# clients from working can actually be fun but also frustrating troubleshooting too. Find out how from William here. […]

    Reply
  2. A trip down memory lane with the vSphere C# Client and ESXi 6.7 & 7.0 says:
    04/06/2020 at 9:14 am

    […] For those that can remember, when the vSphere C# Client first attempts to connect to to an ESXi host, it download a clients.xml file to help it determine if it needs to be updated. Since the last version of the vSphere C# Client is 6.0, we have to trick it into thinking our ESXi 7.0 or 6.7 host is actually 6.0 by update the clients.xml file. This idea came from a blog post I wrote about back in 2012 on blocking vSphere C# Client logins […]

    Reply
  3. Automated Lab Deployment Script for VMware Cloud Foundation (VCF) 4.2 says:
    05/26/2021 at 11:57 am

    […] Blocking vSphere C# Client Logins […]

    Reply
  4. How to restrict vSphere UI access while maintaining vSphere API functionality? says:
    06/08/2021 at 9:53 am

    […] is not necessary new. In fact, I was reminded of this article which I wrote back in 2012 on blocking access to the vSphere C# Client, which was implemented quite a bit by customers to encourage usage of the vSphere Flex Client (RIP) […]

    Reply

Leave a Reply to A trip down memory lane with the vSphere C# Client and ESXi 6.7 & 7.0Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search

Thank Author

Author

William is Distinguished Platform Engineering Architect in the VMware Cloud Foundation (VCF) Division at Broadcom. His primary focus is helping customers and partners build, run and operate a modern Private Cloud using the VMware Cloud Foundation (VCF) platform.

Connect

  • Bluesky
  • Email
  • GitHub
  • LinkedIn
  • Mastodon
  • Reddit
  • RSS
  • Twitter
  • Vimeo

Recent

  • Programmatically accessing the Broadcom Compatibility Guide (BCG) 05/06/2025
  • Quick Tip - Validating Broadcom Download Token  05/01/2025
  • Supported chipsets for the USB Network Native Driver for ESXi Fling 04/23/2025
  • vCenter Identity Federation with Authelia 04/16/2025
  • vCenter Server Identity Federation with Kanidm 04/10/2025

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2025