Connect to Entra-joined PC from Mac

You can use the Windows app to connect to an Entra-joined Windows device. If you’re reading this you have most likley hit a variety of errors with different combinations of settings such as:

  • Code: -51410
  • AADSTS293004
  • Something went wrong
  • The User Account Did Not Work

You may have tried things like disabling NLA, using azuread\username@domain.com, etc etc and they haven’t worked. Here’s what worked for me:

  • You MUST connect to the PC using its short hostname.
    • Short hostname can be retrieved by opening a command prompt and running the command hostname. The output from that command is the short hostname
    • That means in whatever is your default search domain for your Mac you need an A record of shortname.homedomain.com pointing to the private IP of your Windows device
    • In my case, I run a recursive resolver on my firewall and added an entry there.
    • You will know you have gotten this to work by opening a Terminal on the Mac and executing a ping against the short name. It must resolve to the IP of the Windows device.
  • You need create an RDP file manually that has two lines added to it
    • enablerdsaadauth:i:1
    • targetisaadjoined:i:1

You will get a modern auth prompt when connecting and you can do full MFA. Use the full UPN of the user you login to the Windows device with.

Bear in mind – This means these logins are subject to CA policies so some fiddling may be required depending on your All Cloud Apps policies (Think: Device Compliance).

Here is what my RDP file looks like (You’ll want to swap <shortname> for the correct short hostname of your Windows device):

redirectwebauthn:i:1
redirectlocation:i:0
smart sizing:i:1
armpath:s:
enablerdsaadauth:i:1
targetisaadjoined:i:1
hubdiscoverygeourl:s:
redirected video capture encoding quality:i:0
camerastoredirect:s:*
gatewaybrokeringtype:i:0
use redirection server name:i:0
alternate shell:s:
disable themes:i:0
geo:s:
disable cursor setting:i:1
remoteapplicationname:s:
resourceprovider:s:
disable menu anims:i:1
remoteapplicationcmdline:s:
promptcredentialonce:i:0
gatewaycertificatelogonauthority:s:
audiocapturemode:i:1
prompt for credentials on client:i:1
allowed security protocols:s:*
gatewayhostname:s:
remoteapplicationprogram:s:
gatewayusagemethod:i:2
screen mode id:i:1
use multimon:i:0
authentication level:i:2
desktopwidth:i:0
desktopheight:i:0
redirectsmartcards:i:1
redirectclipboard:i:1
forcehidpioptimizations:i:1
full address:s:<shortname>
drivestoredirect:s:*
loadbalanceinfo:s:
networkautodetect:i:1
enablecredsspsupport:i:1
redirectprinters:i:1
autoreconnection enabled:i:1
session bpp:i:32
administrative session:i:0
audiomode:i:0
bandwidthautodetect:i:1
authoring tool:s:
connection type:i:7
remoteapplicationmode:i:0
disable full window drag:i:0
gatewayusername:s:
dynamic resolution:i:1
shell working directory:s:
wvd endpoint pool:s:
remoteapplicationappid:s:
username:s:
allow font smoothing:i:1
AllowRelativeMouseMode:i:0
connect to console:i:0
disable wallpaper:i:0
gatewayaccesstoken:s:
AllowRelativeMouseMode:i:0
AllowRelativeMouseMode:i:0
AllowRelativeMouseMode:i:0
AllowRelativeMouseMode:i:0
alternate full address:s:<shortname>
disableremoteappcapscheck:i:1
prompt for credentials:i:1
redirectcomports:i:1
span monitors:i:1

Fortinet IPSec Client VPN Failing Due To Local-In Policies

I recently reconfigured my Fortigate to offer IKEv2 IPSec VPN instead of SSL. Fortinet is discontinuing support for SSL VPN and other features on models with 2GB RAM. This includes the 40 and 60 series Fortigates; IPSec will still work.

I had done this sort of configuration before, its documented in many places, I won’t repeat it here. After 15-20 minutes of config, I was able to connect to the VPN using a local username and password on the Fortigate BUT couldn’t pass traffic. I ran debug flows and captures everything looked correct. I would see the packets allowed by policy, sent to the correct interface but no return traffic.

Searched everywhere, tried everything until I found a note in a KB article about geo-IP restrictions on local-in policies.

Local-In Policies

You cannot use standard GUI firewall policies to filter traffic that is destined for the Fortigate itself (as opposed to traffic with a destination behind the Fortigate). Most people “firewall” the management interfaces by using the trusted hosts associated with the admin username. With the proliferation of CVE’s for Fortigate SSL VPN I wanted to cut down that surface as well: enter local-in policies. They must be configured through the CLI but they allow you to apply standard firewall constructs to VPN, FGM, management. I had limited access to the SSL-VPN to only the United States geo-IP location to cut down on scanners. There is a bug that if a geo-IP restriction is applied to SSL-VPN it will cause the IPSec VPN traffic to have the problem I’m experiencing. As soon as I removed the geo IP restriction from SSL-VPN BAM – My IPSec traffic worked perfectly. What a weird bug.

The New World of Teams Webhooks

As you may have heard, Microsoft in their infinite wisdom has decided to retire “Office 365 Connectors” for Teams. At first this sounds innocuous until you realize this also includes the incoming webhook connector which allows webhooks to trigger Teams messages. Thats a very handy feature in the world of automation.

The replacement solution is to use “Workflows” which is really just a fancy name for PowerAutomate also/previously/better known as Flow. There are a variety of reasons why this is less than ideal but it is what it is. Unfortunately, the template that Microsoft supplies is not a drop in replacement. Specifically, the template assumes that you will be sending multiple JSON attachments (not in the body) that are each in the “Adaptive Card” format. Unlikely for any existing apps.

What we want to do is grab the values from JSON supplied in the webhook and post with those variables into a chat or channel. You can do that by starting with a blank Flow and using the “When a Teams webhook request is received” trigger.

Then use a Parse JSON action and supply the schema of the JSON message you will be sending. Use the “sample payload” link to generate the schema for you. This example has a JSON message with two values: name and age

Once you’ve done this you can add a “Post a message” action and access the variables from within the JSON

The Case of the Missing PowerBI Credentials

I migrated a user from AWS Workspaces to AVD to improve performance on POwerBI queries. The migration did indeed significantly increase performance but it also introduced an odd issue: When opening the PowerBI Desktop file the Snowflake credentials store in the file “could not be decrypted.” Every. Time. This behavior was not seen on AWS.

Most Googling on this topic talked about clearing caches and re-entering credentials but none of that worked. There was also an interesting consistency to the issue. It would happen the first time it was opened after a login, every time, but subsequent opens in the same AVD session would work correctly. I started to focus on what was different between AWS and AVD

  • Client OS – Windows 11 vs. Windows Server with Desktop Experience
  • FSLogix profile containers
  • Domain join (AWS) vs Entra join (AVD)
  • Access protocol (PCoIP vs AVD)

I also zoomed in on the error being that the credentials “could not be decrypted” which implied to me there was some sort of data corruption or missing private key. Data missing from a profile and prior experience with the technology made me point to FSLogix. More research indicated that PowerBI credentials are encrypted using the data protection API (DPAPI) which I had never heard of. Googling that technology pointed me to a policy setting I had never seen mentioned in another article LoadAadCredKeyFromProfile from the RemoteDesktop CSP. This policy setting is required if you are using FSLogix with Entra joined VMs. It allows the loading of DPAPI keys from the profile. I created an Intune configuration profile and pointed it to a dynamic device group with my AVD session hosts in it. Problem solved.

Unable to load Edge Workspaces

I had a user recently request to use the Edge Workspaces feature. This feature allows you to create pre-defined sets of tabs and bookmarks that can be shared amongst users and centrally managed. When he clicked on the Workspaces button in Edge he would receive “Unable to load” and a retry button.

I started by using every combination of Enabling Workspaces from Intune Templates and Settings Catalog. No dice.

Extensive Googling really just boiled down to “sign out and back into Edge” over and over. That did not work. We had recently completed an Office 365 migration as a result of a merger and he noted that it worked in his source company profile but not in the migrated one. Eventually it dawned on me – Where is the Workspaces data stored? OneDrive.

The files related to Workspaces are stored in OneDrive in the Apps\Microsoft Edge\Edge Workspaces folder. By deleting that folder it cleared out any conflicts with the data from the migration and allowed Workspaces to load.

If you are having the constant “Unable to Load” error on workspaces even after signing out and back into your profile: Delete the Apps\Microsoft Edge\Edge Workspaces in your OneDrive and it should load properly.