Forum Discussion
Rambo363636
Jul 19, 2024Brass Contributor
How to delete files remotely on Intune devices
Hi All,
Please help me to delete below files at below location remotely on all intune devices.
%appdata%\Microsoft\usertemplates\wordtemplate1.dotx
%appdata%\Microsoft\usertemplates\wordtemplate1.dotm
Thank you
1 Reply
Sort By
- Matt_Clarke-ESiCopper Contributor
Good day,
The way I would do it is to use Scripts and remediations.
(I've updated the path to Microsoft\templates and not Microsoft\usertemplates so edit it back if you need to.)
$1dotx = "C:\Users\*\AppData\Roaming\Microsoft\templates\wordtemplate1.dotx"
If(Test-Path -Path $dotx1){Remove-Item -Path $1dotx -Force}
$1dotm = "C:\Users\*\AppData\Roaming\Microsoft\templates\wordtemplate1.dotm"
If(Test-Path -Path $dotm1){Remove-Item -Path $1dotm -Force}I would suggest wrapping in a try catch, and add error handling as well.
Best wishes, Matt