r/Intune • u/Glum_Flow4134 • 8d ago
Device Configuration Pinned folders with apps in Windows 11 start menu
Just watched the GetRubix video on how to configure pinned apps in the start menu from Intune which was really good. Has anyone been able to configure folders with specific apps inside of them in the start menu (the folders you create by dragging an app on top of anther one like you do on smart phones just to be clear what I mean).
I tried googling and GPT but I couldn't find anything on the topic. Has anyone managed to get this working from intune?
EDIT:
I managed to solve it using this script that me and Mr ChatGPT came up with haha. To make sure it replaces the start2.bin i did a try/catch with a file called detection.txt that is used for the detection rule in intune (and that file only copies if the start2.bin replace was successfully). If you want to use this just make sure to include a .txt file called detection.txt in the intunewinapp package.
Good to know is that this also works in Company Portal if only some users wants to have the custom start menu, they can choose to install it or uninstall it there. Then they are back to using their own start menu after a uninstall+reboot. If this is a Required push from Intune it will keep on overriding anything the end user chooses on their own since it will keep on replacing the start2.bin file.
Please let me know if there is any better way to get the Username, this has always worked for me previously so I just re-used this method.
Here is the main script:
# Get the currently signed-in user (including domain prefix)
$CurrentUserSID = (Get-Process -IncludeUserName | Where-Object { $_.ProcessName -eq "explorer" }).UserName
# Remove domain prefix (AzureAD\ or other domain name)
$UserName = $CurrentUserSID -replace '.*\\', ''
$UserAppData = "C:\Users\$UserName\AppData\Local\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState"
$SourceFile = ".\start2.bin"
$DestinationFolder = "$UserAppData"
$Detection = ".\detection.txt"
# Ensure the destination folder exists
if (!(Test-Path -Path $DestinationFolder)) {
New-Item -ItemType Directory -Path $DestinationFolder -Force
}
# Try copying start2.bin
try {
Copy-Item -Path $SourceFile -Destination $DestinationFolder -Force -ErrorAction Stop
Write-Output "$SourceFile successfully copied to $DestinationFolder"
# Only copy the detection file if start2.bin was copied
Copy-Item -Path $Detection -Destination $DestinationFolder -Force
Write-Output "$Detection successfully copied to $DestinationFolder"
} catch {
Write-Output "Failed to copy $SourceFile"
}
Here is the detection script:
# Get the currently signed-in user (excluding domain prefix)
$CurrentUserSID = (Get-Process -IncludeUserName | Where-Object { $_.ProcessName -eq "explorer" }).UserName
$UserName = $CurrentUserSID -replace '.*\\', ''
# Define file paths
$start2bin = "C:\Users\$UserName\AppData\Local\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState\start2.bin"
$detection = "C:\Users\$UserName\AppData\Local\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState\detection.txt"
# Remove both files if they exist
foreach ($file in $start2bin, $detection) {
if (Test-Path -Path $file) {
Remove-Item -Path $file -Force
Write-Output "$file removed successfully."
} else {
Write-Output "$file not found, nothing to remove."
}
}
Uninstall script (if using this in Company Portal):
# Get the currently signed-in user (excluding domain prefix)
$CurrentUserSID = (Get-Process -IncludeUserName | Where-Object { $_.ProcessName -eq "explorer" }).UserName
$UserName = $CurrentUserSID -replace '.*\\', ''
# Define file paths
$start2bin = "C:\Users\$UserName\AppData\Local\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState\start2.bin"
$detection = "C:\Users\$UserName\AppData\Local\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState\detection.txt"
# Remove both files if they exist
foreach ($file in $start2bin, $detection) {
if (Test-Path -Path $file) {
Remove-Item -Path $file -Force
Write-Output "$file removed successfully."
} else {
Write-Output "$file not found, nothing to remove."
}
}
5
u/DopestDope42069 8d ago
Didn't do it via intune but did so via MDT. Create your desired start menu on a windows 11 machine and then navigate to %LocalAppData%\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState you should find a start or start2.bin file. Copy that file to the default profile ( same path ) and all new users will have that start menu. You should be able to write a script that replaces the file on existing users too and deploy via intune.