Forum Discussion
Rajender_Singh_Rawat
Mar 06, 2023Copper Contributor
FSLogix and Intune
Hey guys, I also have a question around Intune + FSLogix + AVD We are deploying Windows apps using Intune to our Win10 multi session AVD machines and using FSLogix as a profiling solution. The i...
Rajender_Singh_Rawat
Mar 09, 2023Copper Contributor
Thank you for your response, Varun.
is it possible to share the exact steps to achieve this?
is it possible to share the exact steps to achieve this?
Varun_Ghildiyal
Mar 09, 2023Iron Contributor
You want me to share powershell script with you , which can be run at scheduled log on?
- Rajender_Singh_RawatMar 09, 2023Copper Contributoryes, if you can please.
I tried a couple of scripts but they do not seem to be working.- Varun_GhildiyalMar 09, 2023Iron Contributor
Rajender_Singh_Rawat
Test it on a test environment first# Define the path to the FSLogix profile container $profileContainerPath = "C:\Users\FSLogix" # Get the list of user directories in the FSLogix profile container $userDirectories = Get-ChildItem -Path $profileContainerPath -Directory # Loop through each user directory and check for discrepancies foreach ($userDirectory in $userDirectories) { # Get the username associated with the user directory $userName = $userDirectory.Name # Check if the user is assigned to the AVD machine in Intune $assigned = Get-IntuneManagedDevice -Filter "UserName eq '$userName'" | Where-Object { $_.ManagedDeviceName -eq $env:COMPUTERNAME } if (!$assigned) { # The user is not assigned to the AVD machine in Intune, so remove the stale entries Remove-Item -Path "$profileContainerPath\$userName\AppData\Roaming\Microsoft\Windows\Start Menu\*" -Recurse -Force Remove-Item -Path "$profileContainerPath\$userName\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\*" -Recurse -Force Remove-Item -Path "$profileContainerPath\$userName\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\*" -Recurse -Force } }This script checks for any discrepancies between the information stored in the FSLogix profile and the actual state of the AVD machine as managed by Intune. If any discrepancies are found, the script removes the stale entries from the Start menu and taskbar.
Please note that this is just an example script and may require modification to work correctly in your specific environment.