iLAPS implementation based off of PowerShell – Intune Local Administrator Password Solution (iLAPS)
Powershell Implementation:
- Installation script to install and create windows task to run monthly on the first
- Powershell reset script to reset all local admin passwords
- Powershell script to check if password reset is required hourly
Admin UI Web Application Features:
- Search for machines using a configurable machine prefix
- Automatically reseting machine password after configurable amount of hours if not an SuperUser
- Ability for SuperUsers to not trigger an automatic password reset
- Logging of All User Actions
User
andSuperUser
roles in AD for Admin Users
- Deploy Automatically
- Create Admin UI with Ability to Limit access via Azure AD
- Automatically Reset passwords which have been viewed by an admin to verify passwords are always random
- Installation process
- Create Customer Specific Secrets File (Steps below)
- Build Software dependencies (Steps below)
- Deploy Software
- Software dependencies
- GIT Commandline
- Dotnet Core 3.1 SDK
- Powershell 3+
- Clone solution into
c:\dev
- Navigate to
c:\dev\iLAPs
- Copy
settings.template.json
with namesettings.production.local.json
- You can add as many
settings.environment-name.local.json
as you want if you want to be able to build for many environments. To use the new environments modify step13.2
to look like.\Build.ps1 -BuildEnvironment 'environment-name'
- If
BuildEnvironment
is not specified it assumesProduction
- You can add as many
-
Create Resouce Group Named
iLaps-RG
-
Create General Purpose V2 Storage Account (Example name
ilapscustomername
)-
Save storage account name into
settings.production.local.json
field named"Storage-Account-Name": "PasteValueHere"
-
-
Create Shared Access Signature for
Admin UI
-
Allowed Services: Table
-
Allowed Resource Types: Object
-
Allowed Permissions: Read, Write, List, Add, Create, Update
-
Set Start and End Expiration dates
-
Allowed Protocols: Https only
-
Generate SAS and Connection String
-
Save into
settings.production.local.json
field shown below"Admin-UI-Table-Object-Read-Write-List-Add-Create-Update-SAS-Token": "PasteValueHere"
-
-
Scroll down to
Tables
on side navigation bar:-
Create Table called
AdminPasswords
-
Create Table called
ResetPasswords
-
Create Table called
Logs
-
Create Table called
DEMPasswords
-
Save into
settings.production.local.json
field shown below"Admin-Table-Name": "AdminPasswords", "Reset-Table-Name": "ResetPasswords", "DEM-Table-Name": "DEMPasswords", "Log-Table-Name": "Logs"
-
-
Click
Tables
click the elipsis onAdminPassword
table- Select Access Policy
- Click Add Policy
- Name it
Add-Create
- Permissions
Add
andUpdate
- Set start and end time based on your organzations security policy
- Click Ok
- Create another Policy named
Read
withRead
Permissions - Click Ok
-
Click
Tables
click the elipsis onResetPasswords
table- Select Access Policy
- Click Add Policy
- Name it
Read-Update
- Permissions
Read
andUpdate
- Set start and end time based on your organzations security policy
-
Click
Tables
click the elipsis onDEMPasswords
table- Select Access Policy
- Click Add Policy
- Name it
Read-Update
- Permissions
Read
andUpdate
- Set start and end time based on your organzations security policy
-
Create Shared Access Signature for
Installation Script
-
Allowed Services: Blob
-
Allowed Resource Types: Object
-
Allowed Permissions: Read
-
Set Start and End Expiration dates
-
Allowed Protocols: Https only
-
Generate SAS and Connection String
-
Save into
settings.production.local.json
field shown below"Blob-Object-Read-Installer-SAS-Token": "PasteValueHere"
-
-
Scroll down to
Containers
on side navigation bar:-
Create Container named
installation
-
Save into
settings.production.local.json
field shown below"Installer-Container-Name": "installation"
-
-
Navigate back to
iLaps-RG
Resource Group- Click
Add
then search for WebApp - Name WebApp
iLaps-customername
where customername is your customer's name - Runtime Stack:
.Net Core 3.1 (LTS)
- App Service Plan:
- Create New and name it
- Change Size to
S1
- Click
Review + Create
- Click
Create
- Once created naviagte to
TLS/SSL
in new resource- Turn on the
HTTPS Only
setting
- Turn on the
- Click
-
Navigate to
Azure Active Directory
-
Click
App Registrations
-
Click
New Registration
-
Name Application
ILAPS
-
Click
Authentication
and clickAdd a Platform
- Click
Web
- Specify the url as
- US Gov Cloud
https://ilaps-customername.azurewebsites.us/signin-oidc
- US Commercial Cloud
https://ilaps-customername.azurewebsites.com/signin-oidc
- US Gov Cloud
- Add another url for development purposes
https://localhost:5001/signin-oidc
- Click
Configure
- Check
ID Tokens
underImplicit Grant and Hybrid Flows
- Click
-
Navigate to Manifest and replace line 8 which contains
appRoles
with the following"appRoles": [ { "allowedMemberTypes": [ "User" ], "description": "SuperUser user can view passwords but they DO NOT reset automatically", "displayName": "SuperUser", "id": "b4a94c3f-bdd5-4c86-8749-d7f110195a56", "isEnabled": true, "lang": null, "origin": "Application", "value": "SuperUser" }, { "allowedMemberTypes": [ "User" ], "description": "Helpdesk user can view passwords but they reset automatically", "displayName": "User", "id": "574cd779-fece-4f33-aa31-d1374e8ea5ca", "isEnabled": true, "lang": null, "origin": "Application", "value": "User" }, { "allowedMemberTypes": [ "User" ], "description": "User can only see DEM User Tab", "displayName": "DEM", "id": "574cd779-fece-4f33-aa31-d1374e8ea5c2", "isEnabled": true, "lang": null, "origin": "Application", "value": "DEM" } ],
-
Navigate to Manifest and find
publisherDomain
and remember the value for step 8 -
Navigate to
Certificates & secrets
and generate a new secret then save it in step 8 -
Navigate to Overview tab to save the fields below into
settings.production.local.json
"Admin-UI-Domain": "Type publisherDomain here" "Admin-UI-TenantId": "Tenant-GUID", "Admin-UI-ClientId": "App-Registration-Client-GUID", "Admin-UI-ClientSecret":"App-Registration-Client-Secret",
-
Click
API Permissions
- Click
Add a Permission
- Click
Microsoft Graph
- Search and add
Group.Read.All
andUser.Read
- Click
Add Permission
- Get admin permissions granted for
Group.Read.All
(You need this or application could fail to work properly)
- Search and add
- Click
-
Click
Overview
and in the top header click the link next toManaged application in local directory
- Click
Properties
- Toggle
User Assignment required
toYes
- Click
Users and Groups
and add users who should have access to this application.- Add Role based on if the User is a
User
,DEM
or aSuper User
.DEM
has ability to ONLY SEE the DEM tab.Super Users
have the ability to view DEM Tab, passwords without forcing a reset automatically and view access logs
- Add Role based on if the User is a
- Click
-
-
Open
settings.production.local.json
and change set the following settings based on if you are targetingUS Gov Cloud
orUS Commercial Cloud
and yourCustomers Name
-
US Gov Cloud
"Company-Name": "My Gov Customer Name", "Storage-Account-Suffix":"core.usgovcloudapi.net", "Admin-UI-Instance":"https://login.microsoftonline.us/", "Admin-UI-GraphApiUrl" : "https://graph.microsoft.us/beta"
-
US Commercial Cloud
"Company-Name": "My Commercial Customer Name", "Storage-Account-Suffix":"core.windows.net", "Admin-UI-Instance":"https://login.microsoftonline.com/", "Admin-UI-GraphApiUrl" : "https://graph.microsoft.com/beta"
-
-
If you will be using the DEM Management feature, Please Configure your DEMAdminGroups and DEMSuperAdminGroup. Below is an example how to add multiple to each group. DEMAdminGroups can see DEMAccounts Associate to them and DEMSuperAdmin can see all DEM Accounts. IF NOT USING DEM ACCOUNT FEATURE PLEASE CLEAR THE FIELDS LIKE SHOWN IN EXAMPLE 2
-
Configure DEM Admins (if configured please read last step to finish configuration)
"Admin-UI-DEMAdminGroups" : "['DEM_ADMIN_GROUP_NAME','DEM_ADMIN_GROUP_NAME_TWO']", "Admin-UI-DEMSuperAdminGroups" : "['DEM_SUPERADMIN_GROUP_NAME','DEM_SUPERADMIN_GROUP_NAME_TWO']",
-
Disable the Feature
"Admin-UI-DEMAdminGroups" : "", "Admin-UI-DEMSuperAdminGroups" : "",
-
-
Open
Azure Storage Explorer
-
Login to Azure and find the storage account we just created
-
Open the
Tables
section -
Right Click
AdminPasswords
table-
Click
Get Shared Access Signature...
-
Click
Access Policy
and selectAdd-Create
-
Click Create
-
Copy the
Query String
-
Save into
settings.production.local.json
field named"Table-Object-Add-Create-SAS-Token": "PasteValueHere"
-
-
Click
Back
and change theAccess Policy
toRead
-
Click Next
-
Copy the
Query String
-
Save into
settings.production.local.json
field named"Table-Object-Read-List-SAS-Token": "PasteValueHere"
-
-
-
Right Click
ResetPasswords
table- Click
Get Shared Access Signature...
- Click
Access Policy
and selectRead-Update
- Click Create
- Copy the
Query String
-
Save into
settings.production.local.json
field named"Table-Object-Read-Update-SAS-Token": "PasteValueHere"
-
- Click
-
Right Click
DEMPasswords
table- Click
Get Shared Access Signature...
- Click
Access Policy
and selectRead-Update
- Click Create
- Copy the
Query String
-
Save into
settings.production.local.json
field named"DEM-Table-Object-Read-Update-SAS-Token": "PasteValueHere"
-
- Click
-
-
Ensure you have .NET Core 3.1 SDK installed
- Open Powershell window and navigate to
c:\dev\iLAPs
- run
.\Build.ps1
- Open Powershell window and navigate to
-
Open
c:\dev\iLAPs\Output\app-service-advanced-editor-script.json
- Select all text and copy
-
Navigate to
iLaps-RG
in the portal- Click
ilaps
App Service - Click
Configuration
- Click
Advanced Edit
- Paste the copied value right before the last
]
- Click
OK
- Click
- Scroll down to
Advanced Tools
in the side navigation- Click
Go
- Hover over
Tools
then clickZip Push Deploy
- Open
c:\dev\iLAPs\Output\
in File Explorer - Drag
AdminUI.zip
to Zip Deploy Interface (You will see it turn blue)
- Click
- Click
-
Navigate back to
iLaps-RG
Resource Group- Click
ilapscustomername
storage account - Click
Containers
- Click
installation
- Click
Upload
- Navigate to
c:\dev\iLAPs\Output
- Click both
Reset-LocalAdministratorPassword_v2.0.ps1
andCheck-Reset-LocalAdministratorPassword_v2.0.ps1
- Click
Upload
- Navigate to
- Click
-
Navigate to Use PowerShell scripts on Windows 10 devices in Intune
- Deploy the code found in
c:\dev\iLAPs\Output\Install-iLaps_v2.0.ps1
using the guide linked above - Make sure you set Powershell64 or it will fail
- Deploy the code found in
-
If using DEM feature complete this step. Otherwise ENJOY!
- Install and connect to storage account using storage explorer
- Fill out the
DEMPasswords - Import Template.csv
script and hash the password using the hashing script in the Output directory. - The hashing script takes a string input and returns a hashed output. You can automate the script further on your own but this is provided as a starting point. Example Usage :
.\Output\SaltDEMPasswords.ps1 -PW "MyCrazySuperSecretPassword123!@#"
- Navigate to
DEMPasswords
table and import theDEMPasswords - Import Template.csv
- Manually copy the
DEM-Password-Reset-Script.ps1
from theOutputs
folder toC:\Windows\System32
folder on a On-Prem server with AD Powershell Tools installed - Open an Admin Powershell and navigate to
C:\Windows\System32
- Run the command
.\DEM-Password-Reset-Script.ps1
- The script will self install a task which run's hourly and checks the DEM table if it needs to update the Password or not.
- Enjoy