Visual Onboarding Display/Status

Have a way for end users to visually see if an onboarding is running or if it’s complete. Maybe this can be done by using the lock screen/wallpaper? Ideally the solution can handle disconnects and cancellations

We made a Lockscreen wallpaper for this - it’s not perfect and requires a reboot, but it’s fairly simple to implement.

I’d be happy to share it with you - but I agree, a default task would be nice.

I’d love to see what you got

We just created a Metascript task, using only a Set-script (too lazy to make a test for it :stuck_out_tongue: This is the code for the script:

$RegPath = “HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\PersonalizationCSP”
function SetLockscreenImage {
if($RebootPreference -ne “Suppress”){
Write-Host “Changing Lockscreen”
if($LockscreenFile) {

        $LockscreenStatusValue = "1"
        $LockscreenFile = invoke-immycommand {return "$($Using:LockscreenFile)"}
        $LockscreenPath = invoke-immycommand {return "$($env:ProgramData)\ImmyLockscreen"}
        $LockscreenFileName = invoke-immycommand {return (Split-Path "$($Using:LockscreenFile)" -Leaf)}
        $LockscreenInDestination = invoke-immycommand {return Join-Path "$($Using:LockscreenPath)" "$($Using:LockscreenFileName)" }
        $LockscreenFile | FileShould-Be -InPath $LockscreenPath
        
    }
    $Test1 = Get-WindowsRegistryValue -Path $RegPath -Name "LockScreenImagePath" | RegistryShould-Be -Value $LockscreenInDestination -Type String | Test-All
    $Test2 = Get-WindowsRegistryValue -Path $RegPath -Name "LockScreenImageStatus" | RegistryShould-Be -Value $LockscreenStatusValue -Type DWord | Test-All
    $Test3 = Get-WindowsRegistryValue -Path $RegPath -Name "LockScreenImageUrl" | RegistryShould-Be -Value $LockscreenInDestination -Type String | Test-All
    $Result = $Test1 -and $Test2 -and $Test3
    if(($method -eq "set") -and ($Result -eq $false)) { #Lockscreen was changed, force explorer restart.
        Write-Host "Rebooting"
        Restart-ComputerAndWait 
    }
}
elseif($RebootPreference -eq "Suppress"){
    Write-Host "Reboots are suppressed - no need to change the lock screen"
    
}

}
$DeviceOnboardingStatus = (Get-ImmyComputer).OnboardingStatus
$DeviceOnboardingStatus

Dont run during Onboarding - this is specifically to avoid an overlap if a “maintenance” task is defined

if($DeviceOnboardingStatus -eq “Onboarded” -and $DontApplyToOnboarding){
SetLockscreenImage
}
elseif($DeviceOnboardingStatus -ne “Onboarded” -and $DontApplyToOnboarding){
write-host “Don’t run while onboarding”
}
else{
SetLockscreenImage
}

Then we have configured the following parameters:

This task is ment to be able to run during maintenance as well, at the very beginning of the maintenance session.
Then users will be rebooted, and asked to not touch the device :slight_smile:

Then we made a second task, “Remove maintenance Lockscreen” which also only uses a set script - this runs at the end of all maintenance:

$RegPath = “HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\PersonalizationCSP”
if($RebootPreference -ne “Suppress”){
Write-Host “Clearing Lockscreen”
$Test1 = Get-WindowsRegistryValue -Path $RegPath -Name “LockScreenImagePath” | RegistryShould-Be -Value $null | Test-All
$Test2 = Get-WindowsRegistryValue -Path $RegPath -Name “LockScreenImageStatus” | RegistryShould-Be -Value $null | Test-All
$Test3 = Get-WindowsRegistryValue -Path $RegPath -Name “LockScreenImageUrl” | RegistryShould-Be -Value $null | Test-All
$Result = $Test1 -and $Test2 -and $Test3
if(($method -eq “set”) -and ($Result -eq $false)) { #Lockscreen was changed, force explorer restart.
Restart-ComputerAndWait
}

}
elseif($RebootPreference -eq “Suppress”){
Write-Host “Reboots are suppressed - no need to change the lock screen”
}