Compare commits

..

15 Commits
v1 ... main

Author SHA1 Message Date
5344f60346 Update upgrade.xml
Some checks failed
PSScriptAnalyzer / PSScriptAnalyzer (push) Has been cancelled
2025-01-28 09:35:43 +01:00
2cf3e363e4 Update msoffice-removal-tool.ps1
Some checks are pending
PSScriptAnalyzer / PSScriptAnalyzer (push) Waiting to run
2025-01-28 09:24:47 +01:00
9147faf70d Update install.xml
Some checks are pending
PSScriptAnalyzer / PSScriptAnalyzer (push) Waiting to run
2025-01-28 09:20:03 +01:00
0ddbcc1d4c Update setup.exe 2025-01-28 09:19:45 +01:00
ae769f70f2 Update msoffice-removal-tool.ps1
Some checks are pending
PSScriptAnalyzer / PSScriptAnalyzer (push) Waiting to run
2025-01-28 09:01:55 +01:00
cb83afe5a2 Update msoffice-removal-tool.ps1
Some checks are pending
PSScriptAnalyzer / PSScriptAnalyzer (push) Waiting to run
2025-01-28 08:49:58 +01:00
29bba81164 Update readme.md
Some checks are pending
PSScriptAnalyzer / PSScriptAnalyzer (push) Waiting to run
2025-01-28 08:48:24 +01:00
Aaron Viehl
d0c16c6c29
Update msoffice-removal-tool.ps1 2024-06-07 10:00:43 +02:00
Aaron Viehl
07863a17e5
Better handling of Office removal 2024-06-07 10:00:20 +02:00
Aaron Viehl
1cae067f4e
Update setup.exe
Update to newest version of Microsoft ODT
2024-06-07 09:54:09 +02:00
Aaron Viehl
0df6fbc3e3
Update setup.exe 2023-09-06 10:06:45 +02:00
Aaron Viehl
2d6b9827e5
Fixed setup uninstall 2023-01-26 13:38:14 +01:00
Aaron Viehl
ddc87495e0
Update msoffice-removal-tool.ps1
Debugging is fun ... so I decided to remove the "exit" used for debug purposes ...
2023-01-26 13:32:33 +01:00
Aaron Viehl
a93679164e
Update readme.md 2023-01-18 12:40:26 +01:00
Aaron Viehl
15a65057af
Changed company 2023-01-18 12:38:38 +01:00
5 changed files with 77 additions and 84 deletions

View File

@ -24,10 +24,9 @@
.OUTPUTS
Just output on screen
.NOTES
Version: 1.0
Author: aaron.viehl@frankfurt.einsnulleins.de
Creation Date: 2022-02-04
Purpose/Change: Initial script development
Version: 1.3
Author: Heko Büroservice GmbH & Co. KG.
Creation Date: 2025-01-28
.EXAMPLE
.\msoffice-removal-tool.ps1 -InstallOffice365 -SupressReboot
#>
@ -46,7 +45,7 @@ $SaRA_URL = "https://aka.ms/SaRA_CommandLineVersionFiles"
$SaRA_ZIP = "$env:TEMP\SaRA.zip"
$SaRA_DIR = "$env:TEMP\SaRA"
$SaRA_EXE = "$SaRA_DIR\SaRAcmd.exe"
$Office365Setup_URL = "https://github.com/Admonstrator/msoffice-removal-tool/raw/main/office365-installer"
$Office365Setup_URL = "https://git.heko-technik.de/mkrieger/msoffice-removal-tool/raw/branch/main/office365-installer"
#-----------------------------------------------------------[Functions]------------------------------------------------------------
Function Invoke-OfficeUninstall {
if (-Not (Test-Path "$SaRA_DIR")) {
@ -109,7 +108,7 @@ Function Stop-OfficeProcess {
}
Function Invoke-SaRA {
$SaRAProcess = Start-Process -FilePath "$SaRA_EXE" -ArgumentList "-S OfficeScrubScenario -AcceptEula" -Wait -PassThru -NoNewWindow
$SaRAProcess = Start-Process -FilePath "$SaRA_EXE" -ArgumentList "-S OfficeScrubScenario -AcceptEula -CloseOffice -OfficeVersion All" -Wait -PassThru -NoNewWindow
switch ($SaRAProcess.ExitCode) {
0 {
Write-Host "Uninstall successful!"
@ -138,6 +137,14 @@ Function Invoke-SaRA {
}
Function Invoke-SetupOffice365($Office365ConfigFile) {
if ($Office365ConfigFile -eq "$Office365Setup_URL/purge.xml") {
Write-Host "Downloading Office365 Installer ..."
Start-BitsTransfer -Source "$Office365Setup_URL/setup.exe" -Destination "$SaRA_DIR\setup.exe"
Start-BitsTransfer -Source "$Office365ConfigFile" -Destination "$SaRA_DIR\purge.xml"
Write-Host "Executing Office365 Setup ..."
$OfficeSetup = Start-Process -FilePath "$SaRA_DIR\setup.exe" -ArgumentList "/configure $SaRA_DIR\purge.xml" -Wait -PassThru -NoNewWindow
}
if ($InstallOffice365) {
Write-Host "Downloading Office365 Installer ..."
Start-BitsTransfer -Source "$Office365Setup_URL/setup.exe" -Destination "$SaRA_DIR\setup.exe"
@ -167,22 +174,24 @@ Function Invoke-RebootInSeconds($Seconds) {
}
Function Set-CurrentStage($StageValue) {
if (-not (Test-Path "HKLM:\Software\OEM\101\M365\Install")) {
New-Item -Path "HKLM:\Software\OEM\101\M365\Install" -Force | Out-Null
if (-not (Test-Path "HKLM:\Software\OEM\Heko-Bueroservice-GmbH\M365\Install")) {
New-Item -Path "HKLM:\Software\OEM\Heko-Bueroservice-GmbH\M365\Install" -Force | Out-Null
}
New-ItemProperty -Path "HKLM:\Software\OEM\101\M365\Install" -Name "CurrentStage" -Value $StageValue -PropertyType String -Force | Out-Null
New-ItemProperty -Path "HKLM:\Software\OEM\Heko-Bueroservice-GmbH\M365\Install" -Name "CurrentStage" -Value $StageValue -PropertyType String -Force | Out-Null
}
Function Invoke-Intro {
Write-Host " ___ ___ ___ _____ _____ _____ "
Write-Host "|_ | | |_ | | __| __| |"
Write-Host " _| |_| | |_| |_ | __| __| | | |"
Write-Host "|_____|___|_____| |__| |__| |_|_|_|"
Write-Host ""
Write-Host "Microsoft Office Removal Tool"
Write-Host "by Aaron Viehl (101 Frankfurt)"
Write-Host "einsnulleins.de"
Write-Host ""
Write-Host " _ _ _ ______ _ _ _ "
Write-Host "| | | | | | | ___ (_) (_) (_) "
Write-Host "| |_| | ___| | _____ | |_/ /_ _ _ __ ___ ___ ___ _ ____ ___ ___ ___ "
Write-Host "| _ |/ _ \ |/ / _ \ | ___ \ | | | '__/ _ \/ __|/ _ \ '__\ \ / / |/ __/ _ \"
Write-Host "| | | | __/ < (_) | | |_/ / |_| | | | (_) \__ \ __/ | \ V /| | (_| __/"
Write-Host "\_| |_/\___|_|\_\___/ \____/ \__,_|_| \___/|___/\___|_| \_/ |_|\___\___|"
Write-Host ""
Write-Host "Microsoft Office Removal Tool"
Write-Host "by Max Krieger"
Write-Host "heko-bs.de"
Write-Host ""
}
#-----------------------------------------------------------[Execution]------------------------------------------------------------
@ -197,10 +206,11 @@ if (-Not $Force) {
}
}
Invoke-Intro
# Check if there is a stage to resume
if (-not ($RunAgain)) {
if (Test-Path "HKLM:\Software\OEM\101\M365\Install") {
$CurrentStageValue = (Get-ItemProperty "HKLM:\Software\OEM\101\M365\Install").CurrentStage
if (Test-Path "HKLM:\Software\OEM\Heko-Bueroservice-GmbH\M365\Install") {
$CurrentStageValue = (Get-ItemProperty "HKLM:\Software\OEM\Heko-Bueroservice-GmbH\M365\Install").CurrentStage
Switch ($CurrentStageValue) {
1 {
Write-Host "Resuming Stage 1: Uninstalling Office ..."

View File

@ -1,30 +1,19 @@
<Configuration ID="A9B3AC9B-7436-4348-AFD5-8769F4D06A4A" >
<Add>
<Product ID="O365ProPlusRetail">
<Language ID="MatchOS"/>
<Language ID="MatchPreviousMSI"/>
<ExcludeApp ID="Groove"/>
<ExcludeApp ID="Lync" />
<ExcludeApp ID="Publisher" />
<ExcludeApp ID="Access" />
</Product>
<Product ID="VisioProRetail" MSICondition="VisPro,VisProR">
<Language ID="MatchOS"/>
<Language ID="MatchPreviousMSI"/>
<ExcludeApp ID="Groove"/>
<ExcludeApp ID="Lync" />
<ExcludeApp ID="Publisher" />
<ExcludeApp ID="Access" />
</Product>
<Product ID="ProjectProRetail" MSICondition="PrjPro,PrjProR">
<Language ID="MatchOS"/>
<Language ID="MatchPreviousMSI"/>
<ExcludeApp ID="Groove"/>
<ExcludeApp ID="Lync" />
<ExcludeApp ID="Publisher" />
<ExcludeApp ID="Access" />
</Product>
</Add>
<Remove All="TRUE" />
<RemoveMSI />
<Configuration ID="7d07fe48-5cff-42e4-90e7-f09d3d20c732">
<Info Description="" />
<Add OfficeClientEdition="64" Channel="Current">
<Product ID="O365BusinessEEANoTeamsRetail">
<Language ID="de-de" />
<ExcludeApp ID="Groove" />
<ExcludeApp ID="Lync" />
</Product>
</Add>
<Updates Enabled="TRUE" />
<RemoveMSI />
<AppSettings>
<Setup Name="Company" Value="Heko Bueroservice GmbH &amp; Co. KG." />
<User Key="software\microsoft\office\16.0\excel\options" Name="defaultformat" Value="51" Type="REG_DWORD" App="excel16" Id="L_SaveExcelfilesas" />
<User Key="software\microsoft\office\16.0\powerpoint\options" Name="defaultformat" Value="27" Type="REG_DWORD" App="ppt16" Id="L_SavePowerPointfilesas" />
<User Key="software\microsoft\office\16.0\word\options" Name="defaultformat" Value="" Type="REG_SZ" App="word16" Id="L_SaveWordfilesas" />
</AppSettings>
<Display Level="Full" AcceptEULA="TRUE" />
</Configuration>

Binary file not shown.

View File

@ -1,28 +1,19 @@
<Configuration ID="A9B3AC9B-7436-4348-AFD5-8769F4D06A4A" >
<Add>
<Product ID="O365ProPlusRetail">
<Language ID="MatchOS"/>
<Language ID="MatchPreviousMSI"/>
<ExcludeApp ID="Groove"/>
<ExcludeApp ID="Lync" />
<ExcludeApp ID="Publisher" />
<ExcludeApp ID="Access" />
</Product>
<Product ID="VisioProRetail" MSICondition="VisPro,VisProR">
<Language ID="MatchOS"/>
<Language ID="MatchPreviousMSI"/>
<ExcludeApp ID="Groove"/>
<ExcludeApp ID="Lync" />
<ExcludeApp ID="Publisher" />
<ExcludeApp ID="Access" />
</Product>
<Product ID="ProjectProRetail" MSICondition="PrjPro,PrjProR">
<Language ID="MatchOS"/>
<Language ID="MatchPreviousMSI"/>
<ExcludeApp ID="Groove"/>
<ExcludeApp ID="Lync" />
<ExcludeApp ID="Publisher" />
<ExcludeApp ID="Access" />
</Product>
</Add>
<Configuration ID="7d07fe48-5cff-42e4-90e7-f09d3d20c732">
<Info Description="" />
<Add OfficeClientEdition="64" Channel="Current">
<Product ID="O365BusinessEEANoTeamsRetail">
<Language ID="de-de" />
<ExcludeApp ID="Groove" />
<ExcludeApp ID="Lync" />
</Product>
</Add>
<Updates Enabled="TRUE" />
<RemoveMSI />
<AppSettings>
<Setup Name="Company" Value="Heko Bueroservice GmbH &amp; Co. KG." />
<User Key="software\microsoft\office\16.0\excel\options" Name="defaultformat" Value="51" Type="REG_DWORD" App="excel16" Id="L_SaveExcelfilesas" />
<User Key="software\microsoft\office\16.0\powerpoint\options" Name="defaultformat" Value="27" Type="REG_DWORD" App="ppt16" Id="L_SavePowerPointfilesas" />
<User Key="software\microsoft\office\16.0\word\options" Name="defaultformat" Value="" Type="REG_SZ" App="word16" Id="L_SaveWordfilesas" />
</AppSettings>
<Display Level="Full" AcceptEULA="TRUE" />
</Configuration>

View File

@ -1,14 +1,17 @@
# Microsoft Office Removal Tool
```plain
___ ___ ___ _____ _____ _____
|_ | | |_ | | __| __| |
_| |_| | |_| |_ | __| __| | | |
|_____|___|_____| |__| |__| |_|_|_|
_ _ _ ______ _ _ _
| | | | | | | ___ (_) (_) (_)
| |_| | ___| | _____ | |_/ /_ _ _ __ ___ ___ ___ _ ____ ___ ___ ___
| _ |/ _ \ |/ / _ \ | ___ \ | | | '__/ _ \/ __|/ _ \ '__\ \ / / |/ __/ _ \
| | | | __/ < (_) | | |_/ / |_| | | | (_) \__ \ __/ | \ V /| | (_| __/
\_| |_/\___|_|\_\___/ \____/ \__,_|_| \___/|___/\___|_| \_/ |_|\___\___|
Microsoft Office Removal Tool
by Aaron Viehl (101 Frankfurt)
einsnulleins.de
by Max Krieger
heko-bs.de
```
## Synopsis
@ -38,7 +41,7 @@ By using `-UseSetupRemoval` the Office365 setup method will be used.
## Stage mechanism
To make sure that the program will only do the necessary parts a _stage mechanism_ is builtin. After every stage a registry value will be written to ``HKLM:\Software\OEM\101\M365\Install\CurrentStage``
To make sure that the program will only do the necessary parts a _stage mechanism_ is builtin. After every stage a registry value will be written to ``HKLM:\Software\OEM\Heko-Bueroservice-GmbH\M365\Install\CurrentStage``
To overwrite all stages and restart the whole script use ``-RunAgain``.
@ -47,5 +50,5 @@ To overwrite all stages and restart the whole script use ``-RunAgain``.
You may use this script without explicit download:
```powershell
iwr https://raw.githubusercontent.com/Admonstrator/msoffice-removal-tool/main/msoffice-removal-tool.ps1 -OutFile msoffice-removal-tool.ps1; powershell -ExecutionPolicy Bypass .\msoffice-removal-tool.ps1
iwr https://git.heko-technik.de/mkrieger/msoffice-removal-tool/raw/branch/main/msoffice-removal-tool.ps1 -OutFile msoffice-removal-tool.ps1; powershell -ExecutionPolicy Bypass .\msoffice-removal-tool.ps1
```