WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple

Quick Tip - Encoding emojis in a Microsoft Teams message using O365 API

07.13.2020 by William Lam // Leave a Comment

One easy way to integrate with Microsoft Teams is to use an incoming webhook which can be configured on a per-channel basis. While working on creating some new PowerShell functions for the VMware Event Broker Appliance (VEBA), I was stuck trying to figure out how to properly encode an emoji icon into the MessageCard type for sending a message to a teams channel.

After a bit of searching and some trial/error, I finally found that you needed to use the emoji hex code with the following format:

&#x<EMOJI-HEX-CODE>;

I used this site here to find the emoji to hex code translation. In addition, I also found that the emojis will only render when used in either the activityTitle or text property of the MessageCard. I was initially trying use this within the facts property which does not work.

Here is a working PowerShell example on constructing the the MessageCard JSON which utilizes emojis:

$teamsMessage = [PSCustomObject][Ordered]@{
    "@type"      = "MessageCard"
    "@context"   = "http://schema.org/extensions"
    "themeColor" = '0078D7'
    "summary"      = "VMC SDDC Deleted"
    "sections"   = @(
        @{
            "activityTitle" = "&#x1F6A8; **VMC SDDC Deleted** &#x1F6A8;";
            "activitySubtitle" = "In VMC-Customer[0] Organization";
            "activityImage" = "https://blogs.vmware.com/vsphere/files/2019/07/Icon-2019-VMWonAWS-Primary-354-x-256.png"
            "facts" = @(
                @{
                    "name" = "SDDC:";
                    "value" = "M11-SDDC";
                },
                @{
                    "name" = "Date:";
                    "value" = "2020-07-12T11:20:03.364000Z";
                },
                @{
                    "name" = "User:";
                    "value" = "*protected email*";
                }
            );
            "markdown" = $true;
            "text" = "&#x1F629; This is the text field &#x1F629;";
        }
    )
}

$body = $teamsMessage | ConvertTo-Json -Depth 5
Invoke-WebRequest -Uri $teamsWebhookURL  -Method POST -ContentType "application/json" -Body $body | Out-Null

Here is what the rendered Microsoft Teams message will looks like posting to the webhook:

Categories // Uncategorized Tags // Emojis, Microsoft Teams

Custom notification and automation based on host failure in VMware Cloud on AWS

07.09.2020 by William Lam // Leave a Comment

Physical hardware failure is inevitable, this is true whether it is running in your on-premises datacenter or in the Cloud like VMware Cloud on AWS. Although vSphere HA will automatically restart all affected VMs after detecting a host failure, there is usually additional activities that must be performed by a customer such as notifying all impacted application owners and even creating an incident ticket for hardware replacement.

With VMware Cloud on AWS, the hardware replacement is done automatically for you but the downstream activity of notifying application owners to verify the application is functional is still managed by the customer. There are many ways in how customers can manage such incidents and one solution that I am a huge advocate of is taking advantage of the powerful vCenter Server Events, which has over 1700+ events, not to mention any of the 2nd/3rd party events.

When an ESXi host fails, the com.vmware.vc.HA.DasHostFailedEvent event will be generated which contains all the relavent information related to the host failure including the specific hostname/IP, when the incident occurred and details about the vSphere Cluster and Datacenter is also provided. This information is visible using the vSphere UI but it can also be programmatically retrieved using the vSphere API, which is how the vSphere UI renders this information.

Note: Everything described in this blog post including the VEBA example is applicable to any environment that contains vCenter Server and is not limited to just VMware Cloud on AWS.

[Read more...]

Categories // Automation, VMware Cloud on AWS Tags // VEBA, VMC, VMware Cloud on AWS, VMware Event Broker Appliance

Configuring dnsmasq as PXE Server for ESXi 

07.09.2020 by William Lam // 2 Comments

One really cool thing that I came to learn while setting up the infrastructure to network boot the latest Raspberry Pi 4 was the use of dnsmasq, which I have used in the past but I did not realize it could do so much more. In addition to providing DNS services, it can also be configured to run TFTP and provide DHCP capabilities which can then be used to support PXE installations.

Another neat feature of dnsmasq is ability to proxy to an existing DHCP server which is extremely useful for anyone with an existing DHCP infrastructure. Given the simplicity of dnsmasq and having already set this up for the rPI, I figure it would also be useful to take folks through in setting up dnsmasq to also support ESXi installations over PXE, since this still comes up from new folks just getting started with ESXi kickstart automation.

For more details about PXE installation of ESXi, I highly recommend this whitepaper and although it states 6.0, the concepts and configurations are still applicable to the latest ESXi 7.0 release.

[Read more...]

Categories // Automation, ESXi, vSphere 7.0 Tags // dnsmasq, ESXi, kickstart, pxe boot

  • « Previous Page
  • 1
  • …
  • 179
  • 180
  • 181
  • 182
  • 183
  • …
  • 561
  • Next Page »

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

  • VMware Flings is now available in Free Downloads of Broadcom Support Portal (BSP) 05/19/2025
  • VMUG Connect 2025 - Minimal VMware Cloud Foundation (VCF) 5.x in a Box  05/15/2025
  • 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

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

 

Loading Comments...