Hello Shravani,
Thank you for your question and for reaching out with your question today.
Certainly! I can help you with creating a PowerShell script using PSADT (PowerShell App Deployment Toolkit) to configure a Lockscreen slideshow in Windows 11 and assist you with deploying it through Intune. PSADT provides a framework for creating deployment scripts with advanced features.
Here's an example script that you can use as a starting point:
#Requires -Version 5.0
# Define script parameters
param (
[string]$SourceFolderPath, # Folder path containing the lockscreen images
[int]$IntervalInSeconds = 30 # Slideshow interval in seconds
)
# Import the PSADT module
Import-Module "$PSScriptRoot\Toolkit\AppDeployToolkitMain.ps1" -Force
# Define the main installation function
function Install-MyLockscreenSlideshow {
# Create a temporary folder to copy the lockscreen images
$tempFolder = Join-Path -Path $env:TEMP -ChildPath "LockscreenImages"
New-Item -ItemType Directory -Path $tempFolder | Out-Null
try {
# Copy the lockscreen images to the temporary folder
Copy-Item -Path $SourceFolderPath -Destination $tempFolder -Recurse -Force
# Configure the Lockscreen slideshow
Set-ItemProperty -Path "HKCU:\Control Panel\Personalization\Desktop Slideshow" -Name "ImagesRootPath" -Value $tempFolder
Set-ItemProperty -Path "HKCU:\Control Panel\Personalization\Desktop Slideshow" -Name "Interval" -Value $IntervalInSeconds
# Refresh the Lockscreen settings
$result = Invoke-Expression -Command 'RUNDLL32.EXE USER32.DLL,UpdatePerUserSystemParameters ,1 ,True'
if ($result -eq 0) {
Write-Host "Lockscreen slideshow configuration applied successfully."
} else {
Write-Host "Lockscreen slideshow configuration failed."
}
}
finally {
# Cleanup the temporary folder
Remove-Item -Path $tempFolder -Recurse -Force
}
}
# Call the main installation function
Install-MyLockscreenSlideshow
# Execute the PSADT functions
If (-not (Test-RunningInAppVirt)) {
# Execute the main installation function
Execute-Installation
}
In the above script, you need to specify the $SourceFolderPath
parameter with the path to the folder containing your lockscreen images. The $IntervalInSeconds
parameter sets the interval between each image change in the slideshow (default is 30 seconds).
To deploy this script using Intune, you can follow these steps:
- Create a new package in Intune and upload the script file along with the PSADT module folder.
- Configure the script settings by providing the required parameters.
- Assign the package to the desired user groups in Intune.
When the package is deployed, the script will run on the assigned devices, setting up the Lockscreen slideshow with the specified images and interval.
Note: Make sure you have the PSADT module folder alongside the script file in the package, and update the path to the AppDeployToolkitMain.ps1
file in the script accordingly.
Please note that testing the script thoroughly in your environment is recommended before deploying it widely.
I hope this helps you get started with creating the Lockscreen slideshow script and deploying it through Intune!
I used AI provided by ChatGPT to formulate part of this response. I have verified that the information is accurate before sharing it with you.
If the reply was helpful, please don’t forget to upvote or accept as answer.