Forum Discussion
Rob_Lam
Jul 30, 2024Copper Contributor
LAPS Creation using Intune
Hi All I am trying to get Intune to create a Local Admin Account and I am using the method of adding OMA-URI Settings but for some reason the account is created but it's not adding to the a...
Rob_Lam
Aug 10, 2024Copper Contributor
Hi
No there isn't any reason.
The reason behind it was that the script didn't work so I tried OMA-URI settings.
In both scenarios they both create the apexadmin account but does not add it to local admin group
All our machines are running Windows 11 23H2.
No there isn't any reason.
The reason behind it was that the script didn't work so I tried OMA-URI settings.
In both scenarios they both create the apexadmin account but does not add it to local admin group
All our machines are running Windows 11 23H2.
ppel123
Aug 10, 2024Copper Contributor
I find it weird that the user is not being added to the local admin group.
What I would do is build a troubleshooting mechanism to understand at which point it fails.
First of all if you run the script that creates the user and add it to the local admin group locally on a local machine or on demand on a test machine, does it work?
If yes then add some logging to your script:
Start-Transcript -Path "C:\ProgramData\Microsoft\IntuneManagementExtension\Logs\LocalAdminScriptLogs.txt" -Append -ErrorAction Stop
try{
# you code goes here with write hosts to depict the code flow into the log file
# add -ErrorAction stop to throw errors to the catch clause
}
catch{
# depict the error to the log file
Write-Error "An error occurred during detection: $_"
}
finally{
Stop-Transcript
}
Then you could collect the logs following this guide.