Forum Discussion
FSLogix and Intune
It sounds like there might be some inconsistency between the information stored in the FSLogix profile and the actual state of the AVD machine as managed by Intune. One potential solution is to configure FSLogix to perform a cleanup of stale entries during logon or logoff.
You can configure FSLogix to clean up stale entries by modifying the "Profile Container" settings in the FSLogix configuration file (i.e., fslogix\ProfileContainer\ProfileContainerOffice365.xml). Specifically, you can set the "CleanupStaleUserDirectoriesOnLogoff" parameter to "true" to enable automatic cleanup of stale user directories during logoff.
Another potential solution is to use a PowerShell script to perform a cleanup of stale entries. The script could be configured to run at logon or logoff and could check 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 could remove the stale entries from the Start menu and taskbar.
To further troubleshoot the issue, you may want to check the event logs on the AVD machines and in the Intune console to see if there are any errors or warnings related to the deployment and removal of apps.
is it possible to share the exact steps to achieve this?
- Varun_GhildiyalMar 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.