{"id":773,"date":"2022-11-04T09:30:06","date_gmt":"2022-11-04T13:30:06","guid":{"rendered":"https:\/\/anthonyfontanez.com\/?p=773"},"modified":"2022-11-04T09:51:16","modified_gmt":"2022-11-04T13:51:16","slug":"remotely-managing-windows-endpoints-part-ii-azure-ad-joined-hosts","status":"publish","type":"post","link":"https:\/\/anthonyfontanez.com\/index.php\/2022\/11\/04\/remotely-managing-windows-endpoints-part-ii-azure-ad-joined-hosts\/","title":{"rendered":"Remotely Managing Windows Endpoints Part II: Azure AD Joined Hosts"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<p><a href=\"https:\/\/ajf.one\/winrm\" data-type=\"URL\" data-id=\"https:\/\/ajf.one\/winrm\" target=\"_blank\" rel=\"noreferrer noopener\">Part I<\/a><\/p>\n\n\n\n<p>Alright, now on to where things get more complicated, WinRM connections to and from Azure AD joined clients. I&#8217;m going to use two acronyms throughout this post that I want to define now:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>HAADJ &#8211; A Hybrid Azure AD Joined device. For the context of this post, this device could also be a purely AD joined device.<\/li>\n\n\n\n<li>AADJ &#8211; A purely Azure AD Joined, specifically logged into with a hybrid (synced via Azure AD Connect) identity.<\/li>\n<\/ul>\n\n\n\n<p>There are two scenarios I&#8217;ll cover, each with their own nuisances: Azure AD clients as the source, and as the destination. If you&#8217;re following along from Part I, I&#8217;ve since reverted the existing WinRM firewall rule on my servers to normal, so no IPSec is required.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"#a-h\" data-type=\"internal\" data-id=\"#a-h\">AADJ -&gt; HAADJ WinRM<\/a><\/li>\n\n\n\n<li><a href=\"#h-a\" data-type=\"internal\" data-id=\"#h-a\">HAADJ -&gt; AADJ WinRM<\/a><\/li>\n\n\n\n<li><a href=\"#conclusion\" data-type=\"internal\" data-id=\"#conclusion\">Conclusion<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"a-h\">AADJ -&gt; HAADJ WinRM<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<p>From an AADJ client, let&#8217;s just try to etsn to a server and specify credentials. Surely it will just work, right? I&#8217;ve got Azure AD Connect in place, along with Azure AD Kerberos and Hybrid Cloud Kerberos Trust. I can log in with Windows Hello for Business and successfully access on-premises resources without issue. Well&#8230;<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"859\" height=\"349\" src=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-3.png\" alt=\"\" class=\"wp-image-778\" srcset=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-3.png 859w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-3-300x122.png 300w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-3-768x312.png 768w\" sizes=\"auto, (max-width: 859px) 100vw, 859px\" \/><figcaption class=\"wp-element-caption\">Failed WinRM Connection<\/figcaption><\/figure>\n<\/div>\n\n\n<p>No dice. Since the source client isn&#8217;t domain-joined, and we&#8217;re attempting to use normal WinRM (not over HTTPS), Kerberos mutual authentication at the device level cannot occur. The source device does not have an identity in AD. I guess we&#8217;ll just need to go back to Hybrid devices. Wrong!<\/p>\n\n\n\n<p>We can go about fixing this in two different ways. First, the easy, but less secure route: Trusted Hosts. Let&#8217;s configure a Settings Catalog profile in Intune to set some WinRM settings:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"727\" height=\"851\" src=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-4.png\" alt=\"\" class=\"wp-image-780\" srcset=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-4.png 727w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-4-256x300.png 256w\" sizes=\"auto, (max-width: 727px) 100vw, 727px\" \/><figcaption class=\"wp-element-caption\">WinRM Settings Catalog Configuration Profile<\/figcaption><\/figure>\n<\/div>\n\n\n<p>Similar to the policy we created in AD in part I, I&#8217;m enabling the settings I desire, while additionally configuring the Trusted Host list to include my wildcarded AD domain name. This configuration will instruct the client to not perform Kerberos mutual authentication at the device level, and allow the connection to succeed for that domain. This does pose a security risk, because if a compromised device can assume the DNS name of a domain client, you can inadvertently send your credentials to it.<\/p>\n\n\n\n<p>We can at least counter this by configuring NTLM authentication restrictions on the client, or by adding the user account being used to the Protected Users group to prevent NTLM authentication and only allow Kerberos authentication. Both of these can be pretty powerful in securing your environment further. For now, we&#8217;re going to test this as-is.<\/p>\n\n\n\n<p>If you were to try to run the same command, it will still fail, because we were trying to use the &#8220;short&#8221; name and letting DNS suffix search order handle things. That won&#8217;t fly here, we&#8217;ll now need to use the FQDN in order to connect:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"859\" height=\"349\" src=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-5.png\" alt=\"\" class=\"wp-image-781\" srcset=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-5.png 859w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-5-300x122.png 300w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-5-768x312.png 768w\" sizes=\"auto, (max-width: 859px) 100vw, 859px\" \/><figcaption class=\"wp-element-caption\">Successful WinRM Connection With Trusted Hosts Configured<\/figcaption><\/figure>\n<\/div>\n\n\n<p>We&#8217;re in! But, can we make the connection not rely on Trusted Hosts? Yes, with certificates! Let&#8217;s configure WinRM on the server side to accept connections over HTTPS over port 5986. I already have a PKI infrastructure in place (check out <a href=\"https:\/\/twitter.com\/Christopher83\" data-type=\"URL\" data-id=\"https:\/\/twitter.com\/Christopher83\" target=\"_blank\" rel=\"noreferrer noopener\">Chris Kibble<\/a>&#8216;s excellent series on PKI here: <a rel=\"noreferrer noopener\" href=\"https:\/\/christopherkibble.com\/posts\/standing-up-a-microsoft-certificate-authority-part-1\/\" data-type=\"URL\" data-id=\"https:\/\/christopherkibble.com\/posts\/standing-up-a-microsoft-certificate-authority-part-1\/\" target=\"_blank\">Standing up a Microsoft Certificate Authority<\/a> for more guidance), and server authentication certificates enrolled on my servers for securing IIS and SQL, so let&#8217;s use that certificate for WinRM as well. Two birds stoned at once, right?<\/p>\n\n\n\n<p>Configuring this isn&#8217;t straightforward; it will need to be scripted and deployed via a management tool such as ConfigMgr or Intune. The following is an example script that can configure it; this will need tweaking depending on the environment.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$WCS = Get-CimInstance -ClassName Win32_ComputerSystem\n$FQDN=\"$($WCS.Name).$($WCS.Domain)\"\n$Thumbprint = (Get-ChildItem -Path Cert:\\LocalMachine\\My\\ |\n    Where-Object -FilterScript {\n        $_.EnhancedKeyUsageList -in 'Server Authentication (1.3.6.1.5.5.7.3.1)' -and\n        $_.Issuer -eq 'CN=AJF.ONE CORP SIGNING CA, DC=corp, DC=ajf, DC=one' -and\n        $_.Subject -eq \"CN=$FQDN\"\n    }).Thumbprint\n\nNew-Item -Path WSMan:\\LocalHost\\Listener -Transport HTTPS -Address * -CertificateThumbPrint $Thumbprint \u2013Force<\/code><\/pre>\n\n\n\n<p>Next, we need to go back to our GPO and create a rule for inbound TCP 5986, as there&#8217;s no builtin rule for it.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"433\" height=\"581\" src=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-6.png\" alt=\"\" class=\"wp-image-786\" srcset=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-6.png 433w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-6-224x300.png 224w\" sizes=\"auto, (max-width: 433px) 100vw, 433px\" \/><figcaption class=\"wp-element-caption\">WinRM over HTTPS Firewall Rule<\/figcaption><\/figure>\n<\/div>\n\n\n<p>Next, since I&#8217;m using an internal PKI, I need to configure trusted certificate profiles for the root and subordinate CAs in Intune, which is a straightforward configuration (see <a href=\"https:\/\/learn.microsoft.com\/mem\/intune\/protect\/certificates-pfx-configure\" target=\"_blank\" rel=\"noreferrer noopener\">Configure and use PKCS certificates with Intune<\/a> for further information). Finally, we&#8217;ll remove the Trusted Hosts configuration from the WinRM configuration profile we created earlier, and test things out. First, let&#8217;s try the short name again, but add the <code>-UseSSL<\/code> parameter.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"859\" height=\"349\" src=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-7.png\" alt=\"\" class=\"wp-image-788\" srcset=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-7.png 859w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-7-300x122.png 300w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-7-768x312.png 768w\" sizes=\"auto, (max-width: 859px) 100vw, 859px\" \/><figcaption class=\"wp-element-caption\">WinRM over HTTPS Connection Attempt #1<\/figcaption><\/figure>\n<\/div>\n\n\n<p>Since the certificate issued to my server only contains the FQDN, name matching fails, and the connection fails. One more time, with the FQDN&#8230;<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"859\" height=\"349\" src=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-8.png\" alt=\"\" class=\"wp-image-789\" srcset=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-8.png 859w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-8-300x122.png 300w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-8-768x312.png 768w\" sizes=\"auto, (max-width: 859px) 100vw, 859px\" \/><figcaption class=\"wp-element-caption\">WinRM over HTTPS Connection Attempt #1<\/figcaption><\/figure>\n<\/div>\n\n\n<p>Success! This is a much more secure configuration, as the client is now able to establish a form of trust to validate the server it is connecting to. If a rogue device were to take over the DNS name, and present a certificate with the same name, but an issuer not trusted by the client, connections would fail. As I stated earlier, this methodology will work when connecting to either AD or Hybrid AD joined devices, because the authentication &#8220;source of truth&#8221; for both types is still AD at the end of the day. Now let&#8217;s complicate things further&#8230;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-a\">HAADJ -&gt; AADJ WinRM<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<p>Doing the reverse of the above scenario is a bit trickier. Since we already know utilizing normal WinRM will fail due to Kerberos mutual authentication not being able to complete at the device level, we know we will need to use either Trusted Hosts or certificates.<\/p>\n\n\n\n<p>I&#8217;m going to skip configuring Trusted Hosts here, as it is a similar configuration as before, with a caveat that also affects using certificates: DNS registration. Azure AD clients are NOT a member of an AD domain, and they should NOT be registering DNS records in the AD domain DNS zone. To solve this, I&#8217;m going to create a new DNS zone named <code>aad.ajf.one<\/code> and configure my AADJ clients to use that suffix and have records registered there via DHCP. Then, I&#8217;m going to use the Intune Certificate Connector to issue server authentication certificates to the AADJ clients via a PKCS profile. In a production environment, I&#8217;d most likely opt to use NDES and SCEP as it is a more secure configuration, at the expense of a bit more complexity.<\/p>\n\n\n\n<p>I&#8217;ve created a new DNS zone on my domain controller and configured it to support both nonsecure and secure dynamic updates. This is necessary as the client will not be able to authenticate to AD to securely create records, which is another reason to create a new zone.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"400\" height=\"490\" src=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-11.png\" alt=\"\" class=\"wp-image-796\" srcset=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-11.png 400w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-11-245x300.png 245w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><figcaption class=\"wp-element-caption\">New DNS Zone For AAD Clients<\/figcaption><\/figure>\n<\/div>\n\n\n<p>Next, I&#8217;ll configure the necessary DHCP and DNS settings to make registration work. For DHCP, I will configure option 15 on the reservation for an AAD client to <code>aad.ajf.one<\/code>. For DNS, I&#8217;ll use a configuration profile in Intune for a few settings.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"911\" height=\"296\" src=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-12.png\" alt=\"\" class=\"wp-image-797\" srcset=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-12.png 911w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-12-300x97.png 300w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-12-768x250.png 768w\" sizes=\"auto, (max-width: 911px) 100vw, 911px\" \/><figcaption class=\"wp-element-caption\">DHCP Option 15 For AAD Clients<\/figcaption><\/figure>\n<\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"523\" height=\"502\" src=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-13.png\" alt=\"\" class=\"wp-image-798\" srcset=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-13.png 523w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-13-300x288.png 300w\" sizes=\"auto, (max-width: 523px) 100vw, 523px\" \/><figcaption class=\"wp-element-caption\">DNS Client Settings Catalog Configuration Profile<\/figcaption><\/figure>\n<\/div>\n\n\n<p>After verifying the profile applied via Intune, I can release\/renew DHCP on the AADJ client and confirm the DNS record is created.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1019\" height=\"300\" src=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-14.png\" alt=\"\" class=\"wp-image-799\" srcset=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-14.png 1019w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-14-300x88.png 300w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-14-768x226.png 768w\" sizes=\"auto, (max-width: 1019px) 100vw, 1019px\" \/><figcaption class=\"wp-element-caption\">New DNS Records For Azure AD Client<\/figcaption><\/figure>\n<\/div>\n\n\n<p>We have a success! Note that I configured the DNS suffix search order as well; this is not strictly necessary for what we are configuring for WinRM, but it&#8217;s a good practice. Now, we need to deal with certificate enrollment.<\/p>\n\n\n\n<p>I am already using PKCS to enroll a client authentication certificate, so I just need to set up a new template on my CA and configure a new PKCS profile in Intune and assign it to a group containing my AADJ device.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"400\" height=\"560\" src=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-15.png\" alt=\"\" class=\"wp-image-800\" srcset=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-15.png 400w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-15-214x300.png 214w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><figcaption class=\"wp-element-caption\">Server Authentication Certificate Template For Azure AD Clients<\/figcaption><\/figure>\n<\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"729\" height=\"585\" src=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-16.png\" alt=\"\" class=\"wp-image-801\" srcset=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-16.png 729w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-16-300x241.png 300w\" sizes=\"auto, (max-width: 729px) 100vw, 729px\" \/><figcaption class=\"wp-element-caption\">PKCS Certificate Configuration Profile<\/figcaption><\/figure>\n<\/div>\n\n\n<p>After syncing things up on the client side&#8230;<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-17.png\" alt=\"\" class=\"wp-image-803\" width=\"405\" height=\"515\" srcset=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-17.png 405w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-17-236x300.png 236w\" sizes=\"auto, (max-width: 405px) 100vw, 405px\" \/><figcaption class=\"wp-element-caption\">Server Auth Cert Successfully Enrolled<\/figcaption><\/figure>\n<\/div>\n\n\n<p>Another success! Now, we can use Intune to configure WinRM and a similar form of the script from part I to configure the WinRM HTTPS listener. This time, we&#8217;ll need the script to directly specify the domain name, and we&#8217;ll also have it enable and start the WinRM service. Finally, we&#8217;ll use a firewall rule profile in Intune to open port 5986.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Set-Service -Name WinRM -StartupType Automatic\nStart-Service -Name WinRM\n \n$WCS = Get-CimInstance -ClassName Win32_ComputerSystem\n$FQDN=\"$($WCS.Name).aad.ajf.one\"\n$Thumbprint = (Get-ChildItem -Path Cert:\\LocalMachine\\My\\ |\n    Where-Object -FilterScript {\n        $_.EnhancedKeyUsageList -in 'Server Authentication (1.3.6.1.5.5.7.3.1)' -and\n        $_.Issuer -eq 'CN=AJF.ONE CORP SIGNING CA, DC=corp, DC=ajf, DC=one' -and\n        $_.Subject -eq \"CN=$FQDN\"\n    }).Thumbprint\n\nNew-Item -Path WSMan:\\LocalHost\\Listener -Transport HTTPS -Address * -CertificateThumbPrint $Thumbprint -Force<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"734\" height=\"788\" src=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-18.png\" alt=\"\" class=\"wp-image-805\" srcset=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-18.png 734w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-18-279x300.png 279w\" sizes=\"auto, (max-width: 734px) 100vw, 734px\" \/><figcaption class=\"wp-element-caption\">WinRM over HTTPS Firewall Rule Configuration Profile<\/figcaption><\/figure>\n<\/div>\n\n\n<p>Now, for the moment of truth. Will we be able to successfully connect to an AADJ client from an HAADJ client via WinRM? Well, no, not just yet. What credential do we use? Up to this point, we&#8217;ve been using AD credentials, since we were connecting to effectively AD hosts. A pure AADJ device doesn&#8217;t know how to use those credentials from a WinRM perspective. You can try all of the forms of username you want (like <code>AzureAD\\username@domain.tld<\/code> for example) but it isn&#8217;t going to work. We need to use a local account to finish this off.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"406\" src=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-19-1024x406.png\" alt=\"\" class=\"wp-image-806\" srcset=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-19-1024x406.png 1024w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-19-300x119.png 300w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-19-768x305.png 768w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-19.png 1339w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Failed WinRM Over HTTPS Connection<\/figcaption><\/figure>\n\n\n\n<p>As for making that local account configuration, I leave that up to you. There are various community-based Cloud LAPS solutions out there (such as the one from the <a rel=\"noreferrer noopener\" href=\"https:\/\/msendpointmgr.com\/cloudlaps\/\" data-type=\"URL\" data-id=\"https:\/\/msendpointmgr.com\/cloudlaps\/\" target=\"_blank\">MSEndpointMgr<\/a> folks), as well as <a rel=\"noreferrer noopener\" href=\"https:\/\/learn.microsoft.com\/windows-server\/identity\/laps\/laps-scenarios-azure-active-directory\" data-type=\"URL\" data-id=\"https:\/\/learn.microsoft.com\/windows-server\/identity\/laps\/laps-scenarios-azure-active-directory\" target=\"_blank\">LAPS coming soon to Azure AD<\/a>, so I think this problem will be eventually solved. For my lab demo, I manually set the local Administrator account password and enabled the account.<\/p>\n\n\n\n<p>Finally, the moment you&#8217;ve been waiting for:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-21-1024x503.png\" alt=\"\" class=\"wp-image-809\" width=\"1024\" height=\"503\" srcset=\"https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-21-1024x503.png 1024w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-21-300x147.png 300w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-21-768x377.png 768w, https:\/\/anthonyfontanez.com\/wp-content\/uploads\/2022\/11\/image-21.png 1470w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">WinRM into an Azure AD Client Over HTTPS! WE DID IT!<\/figcaption><\/figure>\n<\/div>\n\n\n<p>Let&#8217;s walk through the above image:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Connected to an Azure AD joined client via WinRM over HTTPS, secured with a valid and trusted certificate issued via internal PKI.<\/li>\n\n\n\n<li>Authenticated using the local Administrator account on the remote device.<\/li>\n\n\n\n<li>Created a PS drive to connect to a share on a server, using an AD domain credential.<\/li>\n\n\n\n<li>Browsed a file on said share.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Is making WinRM into Azure AD joined devices possible? Yes<\/li>\n\n\n\n<li>Can it be done in a secure fashion. Yes<\/li>\n\n\n\n<li>Is it really necessary? No<\/li>\n\n\n\n<li>Is it really neat? Absolutely!<\/li>\n<\/ul>\n\n\n\n<p>In the era of &#8220;modern management&#8221;, I am a firm believer that it&#8217;s time to start treating clients like cattle, the same that we [should] be doing for servers for a while now. Use configuration management platforms such as Intune or ConfigMgr (or both, co-management is great!). Create the policies, scripts, and deployments necessary to get your endpoints in the state you desire, and verify that configuration. These tools have features built-in to ensure that the configuration you specify is in fact configured, and can remediate as needed.<\/p>\n\n\n\n<p>This was a fun experiment, and <a href=\"https:\/\/twitter.com\/jgkps\" data-type=\"URL\" data-id=\"https:\/\/twitter.com\/jgkps\" target=\"_blank\" rel=\"noreferrer noopener\">Johannes <\/a>owes me a beer \ud83c\udf7a<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Part I Alright, now on to where things get more complicated, WinRM connections to and from Azure AD joined clients. I&#8217;m going to use two<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[6,12,20,7],"tags":[2,13,22,3],"class_list":["post-773","post","type-post","status-publish","format-standard","hentry","category-active-directory","category-azure-ad","category-intune","category-security","tag-active-directory","tag-azure-ad","tag-intune","tag-security"],"jetpack_featured_media_url":"","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/anthonyfontanez.com\/index.php\/wp-json\/wp\/v2\/posts\/773","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/anthonyfontanez.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/anthonyfontanez.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/anthonyfontanez.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/anthonyfontanez.com\/index.php\/wp-json\/wp\/v2\/comments?post=773"}],"version-history":[{"count":25,"href":"https:\/\/anthonyfontanez.com\/index.php\/wp-json\/wp\/v2\/posts\/773\/revisions"}],"predecessor-version":[{"id":827,"href":"https:\/\/anthonyfontanez.com\/index.php\/wp-json\/wp\/v2\/posts\/773\/revisions\/827"}],"wp:attachment":[{"href":"https:\/\/anthonyfontanez.com\/index.php\/wp-json\/wp\/v2\/media?parent=773"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/anthonyfontanez.com\/index.php\/wp-json\/wp\/v2\/categories?post=773"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/anthonyfontanez.com\/index.php\/wp-json\/wp\/v2\/tags?post=773"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}