{"id":3605,"date":"2021-06-09T15:31:59","date_gmt":"2021-06-09T14:31:59","guid":{"rendered":"https:\/\/www.lieben.nu\/liebensraum\/?p=3605"},"modified":"2021-06-09T15:31:59","modified_gmt":"2021-06-09T14:31:59","slug":"lightweight-laps-solution-for-intune-mde","status":"publish","type":"post","link":"https:\/\/lieben.nu\/liebensraum\/2021\/06\/lightweight-laps-solution-for-intune-mde\/","title":{"rendered":"Lightweight LAPS solution for INtune (MEM)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><mark style=\"background-color:rgba(0, 0, 0, 0);color:#e10d0d\" class=\"has-inline-color\"><strong>UPDATE: <\/strong>LeanLAPS has finally been &#8216;superceded&#8217; by Microsoft&#8217;s own LAPS \ud83d\ude42<\/mark> <a href=\"https:\/\/techcommunity.microsoft.com\/t5\/microsoft-entra-azure-ad-blog\/introducing-windows-local-administrator-password-solution-with\/ba-p\/1942487\">https:\/\/techcommunity.microsoft.com\/t5\/microsoft-entra-azure-ad-blog\/introducing-windows-local-administrator-password-solution-with\/ba-p\/1942487<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The main differences between Microsoft AAD LAPS and LeanLAPS:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>MS Won\u2019t enable the account if it\u2019s disabled.<\/li>\n\n\n\n<li>MS Won\u2019t create the account if it doesn\u2019t exist.<\/li>\n\n\n\n<li>MS Won\u2019t add it to Administrators group if it\u2019s not a member.<\/li>\n\n\n\n<li>MS Won\u2019t remove accounts from Administrators group if they\u2019re not supposed to be there.<\/li>\n\n\n\n<li>MS has an AAD integrated GUI and RBAC<\/li>\n\n\n\n<li>LeanLAPS requires P2 licensing because it used Proactive Remediations<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>LeanLAPS<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Managing local admin accounts using Intune has a lot of quirks, my tele-colleague Rudy Ooms has already <a rel=\"noreferrer noopener\" href=\"https:\/\/call4cloud.nl\/2021\/04\/dude-wheres-my-admin\/\" target=\"_blank\">written extensively<\/a> about this. He also wrote a PowerShell solution to rotate a specific local admin&#8217;s password and had the genius idea of using <a href=\"https:\/\/docs.microsoft.com\/en-us\/mem\/analytics\/proactive-remediations\" data-type=\"URL\" data-id=\"https:\/\/docs.microsoft.com\/en-us\/mem\/analytics\/proactive-remediations\">Proactive Remediations<\/a> (a MEM feature) to display passwords to admins, integrated \/ free in the Intune Console.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-13.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1660\" height=\"355\" src=\"https:\/\/www.lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-13.png\" alt=\"\" class=\"wp-image-3647\" srcset=\"https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-13.png 1660w, https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-13-300x64.png 300w, https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-13-1024x219.png 1024w, https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-13-768x164.png 768w, https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-13-1536x328.png 1536w\" sizes=\"auto, (max-width: 1660px) 100vw, 1660px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">However, I felt I needed a more lightweight solution that;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>does not require\/modify registry keys<\/li>\n\n\n\n<li>does not store the password locally<\/li>\n\n\n\n<li>can <a rel=\"noreferrer noopener\" href=\"https:\/\/gitlab.com\/Lieben\/assortedFunctions\/-\/blob\/master\/leanLAPS\/generateKeys.ps1\" target=\"_blank\">encrypt the password<\/a> if desired<\/li>\n\n\n\n<li>does not need separate detection and remediation scripts<\/li>\n\n\n\n<li>automatically provisions a local admin account<\/li>\n\n\n\n<li>can remove <span style=\"text-decoration: underline;\"><strong>any<\/strong><\/span> other local admin accounts if desired<\/li>\n\n\n\n<li>can whitelist approved admins or groups from AzureAD or Active Directory<\/li>\n\n\n\n<li>is language\/locale-agnostic (e.g. &#8216;Administrators&#8217; vs &#8216;Administradores&#8217;&#8230;.)<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Thus<em><strong> <a href=\"https:\/\/github.com\/jflieben\/assortedFunctionsV2\/tree\/main\/leanLAPS\" target=\"_blank\" rel=\"noreferrer noopener\">LeanLAPS<\/a><\/strong><\/em> was born!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To install\/use:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1. head into the <a rel=\"noreferrer noopener\" href=\"https:\/\/endpoint.microsoft.com\/#blade\/Microsoft_Intune_Enrollment\/UXAnalyticsMenu\/proactiveRemediations\" target=\"_blank\">Proactive Remediations section of MDE<\/a> and click Create script package:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image.png\"><img loading=\"lazy\" decoding=\"async\" width=\"639\" height=\"141\" src=\"https:\/\/www.lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image.png\" alt=\"\" class=\"wp-image-3607\" srcset=\"https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image.png 639w, https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-300x66.png 300w\" sizes=\"auto, (max-width: 639px) 100vw, 639px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">2. Fill out some details:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a href=\"https:\/\/www.lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"785\" height=\"456\" src=\"https:\/\/www.lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-1.png\" alt=\"\" class=\"wp-image-3608\" style=\"width:785px;height:456px\" srcset=\"https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-1.png 785w, https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-1-300x174.png 300w, https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-1-768x446.png 768w\" sizes=\"auto, (max-width: 785px) 100vw, 785px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">3. Download and doublecheck the config of <a href=\"https:\/\/github.com\/jflieben\/assortedFunctionsV2\/blob\/main\/leanLAPS\/leanLAPS.ps1\" target=\"_blank\" rel=\"noreferrer noopener\">LeanLAPS.ps1<\/a> (e.g. configure if other local admins should be removed, what the local admin name should be and the password length). <em>Make sure to use NotePad++ \/ that the file stays UTF-8 Encoded without a BOM.<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">4. Set both the detection and remediation script to LeanLAPS.ps1 and run it in <strong>64 bit<\/strong>:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-2.png\"><img loading=\"lazy\" decoding=\"async\" width=\"787\" height=\"632\" src=\"https:\/\/www.lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-2.png\" alt=\"\" class=\"wp-image-3609\" srcset=\"https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-2.png 787w, https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-2-300x241.png 300w, https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-2-768x617.png 768w\" sizes=\"auto, (max-width: 787px) 100vw, 787px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">5. Assign to a group and deploy. By default it will run every day, but you can also let it run more or less frequently, which determines how often the password is reset (hourly in below example):<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-7.png\"><img loading=\"lazy\" decoding=\"async\" width=\"822\" height=\"442\" src=\"https:\/\/www.lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-7.png\" alt=\"\" class=\"wp-image-3623\" srcset=\"https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-7.png 822w, https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-7-300x161.png 300w, https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-7-768x413.png 768w\" sizes=\"auto, (max-width: 822px) 100vw, 822px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">6. Deploy, and then click on the script package:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-3.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1147\" height=\"457\" src=\"https:\/\/www.lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-3.png\" alt=\"\" class=\"wp-image-3610\" srcset=\"https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-3.png 1147w, https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-3-300x120.png 300w, https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-3-1024x408.png 1024w, https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-3-768x306.png 768w\" sizes=\"auto, (max-width: 1147px) 100vw, 1147px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">7. Go to Device status and add both output columns:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-5.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1660\" height=\"321\" src=\"https:\/\/www.lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-5.png\" alt=\"\" class=\"wp-image-3613\" srcset=\"https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-5.png 1660w, https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-5-300x58.png 300w, https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-5-1024x198.png 1024w, https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-5-768x149.png 768w, https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-5-1536x297.png 1536w\" sizes=\"auto, (max-width: 1660px) 100vw, 1660px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Congratulations, you can now see the current local admin passwords for all managed Windows 10 devices!<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-14.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1660\" height=\"355\" src=\"https:\/\/www.lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-14.png\" alt=\"\" class=\"wp-image-3648\" srcset=\"https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-14.png 1660w, https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-14-300x64.png 300w, https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-14-1024x219.png 1024w, https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-14-768x164.png 768w, https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/06\/image-14-1536x328.png 1536w\" sizes=\"auto, (max-width: 1660px) 100vw, 1660px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Note: if you wish to <strong>trigger a quick remediation<\/strong>, delete the correct keys under Computer\\HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\IntuneManagementExtension\\SideCarPolicies\\Scripts\\Execution and Reports in the client&#8217;s registry, then restart the IntuneManagementExtension service and the remediation will re-run within 5 minutes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">8. If you want to display an encrypted password in Intune, <a href=\"https:\/\/github.com\/jflieben\/assortedFunctionsV2\/blob\/main\/leanLAPS\/generateKeys.ps1\" target=\"_blank\" rel=\"noreferrer noopener\">generate a public and private key<\/a> and configure the resulting values in gui.ps1 and leanLAPS.ps1<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">9. If you don&#8217;t want LeanLAPS to remove certain preapproved admins or groups as admin, make sure to configure the $approvedAdmins variable.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>RBAC<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you provide e.g. your helpdesk with the correct Intune roles, they will be able to see local admin passwords as reported by above solution:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/08\/proactive-remediation-permissions-intune-MEM.png\"><img loading=\"lazy\" decoding=\"async\" width=\"449\" height=\"96\" src=\"https:\/\/www.lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/08\/proactive-remediation-permissions-intune-MEM.png\" alt=\"\" class=\"wp-image-3673\" srcset=\"https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/08\/proactive-remediation-permissions-intune-MEM.png 449w, https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/08\/proactive-remediation-permissions-intune-MEM-300x64.png 300w\" sizes=\"auto, (max-width: 449px) 100vw, 449px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>GUI<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The community, in the form of Colton Lacy, also added an optional GUI frontend for LeanLAPS which you could use for e.g. helpdesk staff:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-style-default\"><a href=\"https:\/\/www.lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/09\/leanLAPSgui.png\"><img loading=\"lazy\" decoding=\"async\" width=\"798\" height=\"589\" src=\"https:\/\/www.lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/09\/leanLAPSgui.png\" alt=\"\" class=\"wp-image-3683\" srcset=\"https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/09\/leanLAPSgui.png 798w, https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/09\/leanLAPSgui-300x221.png 300w, https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2021\/09\/leanLAPSgui-768x567.png 768w\" sizes=\"auto, (max-width: 798px) 100vw, 798px\" \/><\/a><figcaption class=\"wp-element-caption\"><a href=\"https:\/\/github.com\/jflieben\/assortedFunctionsV2\/blob\/main\/leanLAPS\/gui.ps1\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/github.com\/jflieben\/assortedFunctionsV2\/blob\/main\/leanLAPS\/gui.ps1<\/a><\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Troubleshooting<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If your passwords don&#8217;t rotate correctly, check <a href=\"https:\/\/smsagent.blog\/2021\/04\/27\/a-case-of-the-unexplained-intune-password-policy-and-forced-local-account-password-changes\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/smsagent.blog\/2021\/04\/27\/a-case-of-the-unexplained-intune-password-policy-and-forced-local-account-password-changes\/<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>UPDATE: LeanLAPS has finally been &#8216;superceded&#8217; by Microsoft&#8217;s own LAPS \ud83d\ude42 https:\/\/techcommunity.microsoft.com\/t5\/microsoft-entra-azure-ad-blog\/introducing-windows-local-administrator-password-solution-with\/ba-p\/1942487 The main differences between Microsoft AAD LAPS and LeanLAPS: LeanLAPS Managing local admin accounts using Intune has a lot of quirks, my tele-colleague Rudy Ooms has already written extensively about this. He also wrote a PowerShell solution to rotate a specific local admin&#8217;s &hellip; <a href=\"https:\/\/lieben.nu\/liebensraum\/2021\/06\/lightweight-laps-solution-for-intune-mde\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Lightweight LAPS solution for INtune (MEM)<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[6,12,22,39,43],"tags":[],"class_list":["post-3605","post","type-post","status-publish","format-standard","hentry","category-windows-virtual-desktop","category-ems","category-intune","category-powershell","category-security"],"_links":{"self":[{"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/posts\/3605","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/comments?post=3605"}],"version-history":[{"count":0,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/posts\/3605\/revisions"}],"wp:attachment":[{"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/media?parent=3605"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/categories?post=3605"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/tags?post=3605"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}