Desktop
2 TopicsPowershell - Lock screen & Desktop background issue
I am currently starting to configure for a smaller organisation, using Intune for MDM, I've managed to successfully change my Azure AD login to be a standard user (I don't want every user having full administration rights) - that works well and I've assigned an Azure AD group to have admin privileges. So my next step is to set a corporate lock screen and desktop background image, using https://github.com/geirdybbugt/Archive-Dybbugt.no/blob/master/Win10/Win10-SetWallpaperAndLockscreenFromUri.ps1 script. But I now have an issue, either way I want to handle the script in Intune. Running script as: Run this script using the logged on credentials: No The script runs, but the user doesn't download the image files (having tested with administrative privileges in Powershell - the user doesn't have an internet connection, as the laptop is on wifi). So the lock screen and desktop background don't get set. Run this script using the logged on credentials: Yes The script runs, downloads the files successfully but then can't set the registry keys (as my standard user doesn't have permission to alter registry keys). So the lock screen and desktop background don't get set. Do Powershell scripts run in order - and sequentially? That way I could set two scripts, one to download and one to set the registry keys. Or is there any other way of achieving this? Please bear in mind I'm using Windows 10 Pro - so the usual Intune background settings don't work with. Many thanks.Solved24KViews0likes8CommentsIntune installed desktop shortcut needs to be removed
I created a desktop shortcut via intune windows app (win 32). Here is my script New-Item -Path "c:" -Name "mem" -ItemType "directory" -Force Copy-Item "S:\Shortcuts\UKG.ico" -Destination "c:\mem\UKG.ico" $Shell = New-Object -ComObject ("WScript.Shell") $ShortCut = $Shell.CreateShortcut("C:\users\public\desktop\UKG.lnk") $ShortCut.TargetPath="-------------------------------------" $Shortcut.Arguments="------------------------------------" $ShortCut.IconLocation = "c:\mem\UKG.ico"; $ShortCut.Description = "UKG Shortcut"; $ShortCut.Save() (I replaced the path with ————————) The app works fine and copies the ico file from a network share and places it on the c drive in a folder it creates named mem. Now after creating the shortcut they have decided to use SSO which is a new address. I need to delete the ico file in the mem folder and remove the desktop shortcut. I created a simple script. $ShortcutFile = "$env:Public\Desktop\UKG.lnk" if (Test-Path $ShortcutFile){ Remove-Item $ShortcutFile } else { Write-Output "Shortcut Not Found" } To just delete the shortcut. When I run the script as an admin in powershell it works just fine. If I try and run the script in a normal powershell it fails and says it doesn't have access to the public desktop. I ran the file in Intune as just a script and it fails. I converted it to an intunewin file and added it as an intune windows app (win 32). It successfuly runs on all my pcs but does not remove the icon. I'm at a loss and I really need to remove this icon so I can push the new one. Any suggestions on how to remove it via a script or app? I've checked into remediation scripts but that isn't going to be an option for now.Solved5.8KViews0likes23Comments