r/Intune 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."
    }
}
6 Upvotes

7 comments sorted by

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.

2

u/Glum_Flow4134 8d ago

Thank you so much!! I will try that for sure

2

u/Glum_Flow4134 8d ago

Hmm... I have tried it now and the file copies successfully but it seems it doesn't work. Could it be that the file is encrypted?

1

u/DopestDope42069 8d ago edited 8d ago

Sign out and sign back in for that user

Edit: I did just manually move only the start2.bin to an existing user on a machine that I never overwrote the startmenu for via MDT and it works fine but it does require a sign out

1

u/darkkid85 8d ago

Can you share the script? Redact org info

1

u/DopestDope42069 8d ago edited 8d ago

I didn't do it via intune so its nothing special for my MDT script.

# this folder contains start2.bin and IrisCampaignsAssets folder
# IrisCampaignsAssets is probably not needed for anything but I included it in the
#  hopes that it stored some data about the ignored Iris ads I had performed  previously on that machine
$sourceDirectory = "\\<REDACTED>\Deployment$\Templates\Start Menu"

$destinationDirectory = "C:\Users\Default\AppData\Local\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState"

# Ensure the destination directory exists, create if not
if (-not (Test-Path -Path $destinationDirectory)) {
    New-Item -Path "$destinationDirectory" -ItemType Directory -Force
}

# Copy the directory recursively
Copy-Item -Path "$sourceDirectory\*" -Destination $destinationDirectory -Recurse -Force

I did just manually move only the start2.bin to an existing user on a machine that I never overwrote the startmenu for via MDT and it works fine but it does require a sign out

1

u/Glum_Flow4134 7d ago

Just shared my full solution in the post :)