Deploying Intune LAPS with a Remediation Script and Protection Policy****###### David Bergquist
Senior Cloud Solutions Architect - eGroup Enabling Technologies*Microsoft Intune LAPS (Local Administrator Password Solution) is a feature that allows you to manage the local administrator passwords of your Windows devices enrolled in Intune. It helps you prevent unauthorized access, pass-the-hash attacks, and lateral movement by generating random, complex, and unique passwords for each device. You can also set expiration policies and view the passwords in the Azure portal.***
*However, Intune LAPS requires that your devices have the LAPS agent installed and configured, which can be a challenge for some scenarios. For example, if you have devices that are not domain-joined, or if you have devices that have existing local administrator accounts with custom names or passwords, you may need to perform some additional steps to ensure that Intune LAPS works properly.*
*In this document, we will show you how to deploy Intune LAPS using a remediation script that can handle these scenarios. We will also show you how to use an endpoint security protection policy that leverages app protection to prevent unauthorized access to the LAPS passwords.*
*Table of Contents*Prerequisites* *A Microsoft Intune subscription. * Admin account that has global administrator or Intune administrator permissions. * Windows 10/11 devices enrolled in Intune (Entra ID or hybrid Entra ID joined devices). * A remediation script that can detect and remediate (example provided). + Use of remediations requires Windows license verification to be enabled. Additional info can be found *here.* * An app protection policy that can enforce LAPS passwords (example provided). Steps1. In the Intune Admin Portal, ensure Windows license verification is enabled. To enable Windows license verification, your tenant must have E3/A3 or above licenses. You must be a Global Administrator or an Intune Administrator. * + To enable Windows licenses verification via the Intune Admin portal: - Tenant administration -> Connectors and tokens -> Windows data -> Windows licenses verification: On 2.* Create a remediation script(s) that can detect the existence of the local admin account, and if not, create the account and add it to the local administrators group. The following are examples you can use to detect and remediate:**
**Detect: * $userName = “ADM_ServiceDesk”
$userExists = (Get-LocalUser).Name -Contains $userName
if ($userExists) {
Write-Host “$userName exists”
Exit 0
}
Else {
Write-Host “$userName does not exist.”
Exit 1
}* - *Remediate * $localUser = “ADM_ServiceDesk”
$userExists = (Get-LocalUser).Name -Contains $localUser
if($userExists -eq $false) {
try{
New-LocalUser -Name $localUser -Description “ADM_ServiceDesk Admin Account” -NoPassword
Add-LocalGroupMember -Group “Administrators” -Member $localUser
Exit 0
}
Catch {
Write-error $_
Exit 1
}
}* 3.* Create the Intune remediation script package as follows: (NOTE: I recommend you test this package with some test users and devices prior to rolling out to the masses.)**
*From the Intune Admin portal, go to Endpoint Security -> Manage -> Account Protection:*
*Assign the scope tag(s) if required, then assign the LAPS policy to a group, and save the policy: *5. Verify the deployment and view the passwords. (NOTE: This will take some time for the remediation script to run and the LAPS policy to assign to the device.)****
*PrevPreviousShaping the Future of Technology: Women in IT*NextBlock Top-Level Domains with Intune and Windows Firewall PolicyNext*Learn More About Microsoft Intune*Contact our team today to get started with Microsoft Intune or get your questions answered by our experts!**
*The post Deploying Intune LAPS with a Remediation Script and Protection Policy appeared first on eGroup Enabling Technologies.*