I haven't found a way to prevent AI from being installed but think I have found a way to kill it when it shows up.
Create a folder called C:\Utilities\noai
Save the code below in 3 separate files
- noai.ps1
- noai-on-startup.ps1
- noai-on-login.ps1
Change the log file name in noai-on-startup.ps1 to
$file = "C:\Utilities\noai\noai-on-startup.log"
Change the log file name in noai-on-login.ps1 to
$file = "C:\Utilities\noai\noai-on-login.log"
Create 3 scheduled tasks
- 1 every 5 minutes
- 1 on restart
- 1 on login



$file = "C:\Utilities\noai\noai.log"
echo "=====================================" >> $file
$the_date = Get-Date -Format "yyyyMMdd HH:mm"
$message = $the_date
echo $message >> $file
if((get-process "ai" -ea SilentlyContinue) -eq $Null){
$message = $the\_date + " - ai.exe Not Running"
echo $message >> $file
}
else{
$message = $the\_date + " - AI Running - Will Kill AI"
echo $message >> $file
Stop-Process -processname "ai"
if((get-process "ai" -ea SilentlyContinue) -eq $Null){
$the\_date = Get-Date -Format "yyyyMMdd HH:mm"
$message = $the\_date + " - ai.exe No Longer Running"
echo $message >> $file
}
else{
$message = $the\_date + " - ai.exe Still Running"
echo $message >> $file
}
}
$the_date = Get-Date -Format "yyyyMMdd HH:mm"
$message = $the_date
echo $message >> $file
if((get-process "aimgr" -ea SilentlyContinue) -eq $Null){
$message = $the\_date + " - aimgr.exe Not Running"
echo $message >> $file
}
else{
$message = $the\_date + " - aimgr Running - Will Kill AI"
echo $message >> $file
Stop-Process -processname "aimgr"
if((get-process "aimgr" -ea SilentlyContinue) -eq $Null){
$the\_date = Get-Date -Format "yyyyMMdd HH:mm"
$message = $the\_date + " - aimgr.exe No Longer Running"
echo $message >> $file
}
else{
$message = $the\_date + " - aimgr.exe Still Running"
echo $message >> $file
}
}
$look_for = "C:\Program Files\Microsoft Office\root\vfs\ProgramFilesCommonX64\Microsoft Shared\OFFICE16\ai.exe"
if(Test-Path [$look_for])
{
echo " ai.exe exists"
Remove-Item -Path "$look\_for" -Force
}
$look_for = "C:\Program Files\Microsoft Office\root\vfs\ProgramFilesCommonX64\Microsoft Shared\OFFICE16\ai.dll"
if(Test-Path [$look_for])
{
echo " ai.dll exists"
Remove-Item -Path "$look\_for" -Force
}
$look_for = "C:\Program Files\Microsoft Office\root\vfs\ProgramFilesCommonX64\Microsoft Shared\OFFICE16\aimgr.exe"
if(Test-Path [$look_for])
{
echo " aimgr.exe exists"
Remove-Item -Path "$look\_for" -Force
}
$look_for = "C:\Program Files\Microsoft Office\root\vfs\ProgramFilesCommonX64\Microsoft Shared\OFFICE16\aitrx.dll"
if(Test-Path [$look_for])
{
echo " aitrx.dll exists"
Remove-Item -Path "$look\_for" -Force
}
$look_for = "C:\Program Files\Microsoft Office\root\vfs\ProgramFilesCommonX64\Microsoft Shared\OFFICE16\mlg.dll"
if(Test-Path [$look_for])
{
echo " mlg.dll exists"
Remove-Item -Path "$look\_for" -Force
}