Forum Discussion
ABill1
Oct 26, 2023Iron Contributor
Is it possible to disable search location in file explorer voa intune
Hi all, Is it possible to disable the file search bar which allows users to search for locations ie Appdata via intune?  
Oct 27, 2023
ABill1 With this, all users on a system are granted just Read permissions inside their profile folder. Test this! 🙂 (You must run this as System)
# Loop through all user folders and set permissions on Extensions folders
foreach ($folder in Get-ChildItem -Path c:\users -Directory) {
# Test if Extensions folders is there
if (Test-Path -Path "c:\users\$($folder.name)\AppData\Local\Microsoft\Edge\User Data\Default\Extensions") {
#Try to set permissions, warn if not possible
try {
# Get the ACL for an existing folder
$existingAcl = Get-Acl -Path "c:\users\$($folder.name)\AppData\Local\Microsoft\Edge\User Data\Default\Extensions" -ErrorAction Stop
# Set the permissions that you want to apply to the folder
$permissions = 'Users', 'Write', 'ContainerInherit,ObjectInherit', 'None', 'Deny'
# Create a new FileSystemAccessRule object
$rule = New-Object -TypeName System.Security.AccessControl.FileSystemAccessRule -ArgumentList $permissions
# Modify the existing ACL to include the new rule
$existingAcl.SetAccessRule($rule)
# Apply the modified access rule to the folder
$existingAcl | Set-Acl -Path "c:\users\$($folder.name)\AppData\Local\Microsoft\Edge\User Data\Default\Extensions" -ErrorAction Stop
}
catch {
Write-Warning ("Error setting permissions on {0}" -f $folder.name)
}
}
}
ABill1
Oct 27, 2023Iron Contributor
This stops users writing new folders however they can still delete the folders for the extensions