Hello,
I am using O365/M365 with Clients, which are joined an Azure Domain.
I want to enabel on one client "autologon" for a specific M365 Account. The Client shouldnt be in a Kiosk Mode. Just normal Mode.
Therefore I created on "Endpoint Manager" a Powershell Script:
# MrNetTek
# eddiejackson.net/blog
# 1/2/2020
# free for public use
# free to claim as your own
Function Add-RegPolicy($hive,$path,$type,$name,$data)
{
$ErrorActionPreference= 'silentlycontinue'
$regPath = "$hive`:\$path"
if(-not (Test-Path -path $regPath))
{
# Create Path
New-Item -Path "$regPath" | Out-null
}
# Remove Reg Key
Remove-ItemProperty -Path $regPath -Name $name -Force | Out-Null
# Add Reg Key
Set-ItemProperty -Path $regPath -Name $name -Value $data -PropertyType $type | Out-Null
# Required for Binary
#$hex = $data.Split(',') | % { "0x$_"}
#New-ItemProperty -Path $regPath -Name $name -Value ([byte[]]$hex) -PropertyType $type | Out-Null
}
#Reg Hive + Reg Path + Reg Type + Reg Name + Reg Data
Add-RegPolicy -hive "HKLM" -path "SOFTWARE\Microsoft\Windows NT\CurrentVersion\\\Winlogon" -type String -name "AutoAdminLogon" -data "1"
Add-RegPolicy -hive "HKLM" -path "SOFTWARE\Microsoft\Windows NT\CurrentVersion\\\Winlogon" -type String -name "DefaultUserName" -data "username@domain"
Add-RegPolicy -hive "HKLM" -path "SOFTWARE\Microsoft\Windows NT\CurrentVersion\\\Winlogon" -type String -name "DefaultPassword" -data "Pass"
Then I created an Azure Security Group where I added those clients, which should have the autologin with the defined user.
Then I assigned that Group to the Powershell Script.
The Device Status says "Succeeded" but I do not see this keys updated on the assigend clients.
If I enter this registry keys manually on the client, then it is working.
Best Regards,
Johannes