# Microsoft

# Manually Activate Microsoft Office on KMS Server

Run these commands in Command Prompt as administrator:

- For Office 2016, 2019, 2022: ```
    cd "c:\Program Files\Microsoft Office\Office16"
    ```
    
    If you are using the 32-bit MS Office version installed on 64-bit Windows, you need to use this command:
    
    ```
    CD “C:\Program Files (x86)\Microsoft Office\Office16”
    ```
- Manually specify the KMS server name: ```
    cscript ospp.vbs /sethst:<PI-KMS-DNS-NAME>
    ```
    
    (optionally) You can set the KMS server port number:
    
    ```
    cscript ospp.vbs /setprt:1688
    ```
- Activate your Office copy on the KMS server: ```
    cscript ospp.vbs /act
    ```
- Check the Office activation status: ```
    cscript ospp.vbs /dstatusall
    ```

# Custom installation of Office

First, you’ll need to clear previous installations of Office. You can skip this if Office has never been installed on the machine before:

<div class="section level2" id="bkmrk-uninstall-office-wit">- Uninstall Office with the App and Features option in Windows settings.
- Run `OfficeScrubber.cmd` file from [Office Scrubber](https://github.com/abbodi1406/WHD/raw/master/scripts/OfficeScrubber_11.7z) by abbodi1406 and select `[R] Remove all Licenses` option.

</div>Once you’re done:

<div class="section level2" id="bkmrk-download%C2%A0office-depl">- Download [Office Deployment Tool](https://officecdn.microsoft.com/pr/wsus/setup.exe) (ODT)
- Copy the downloaded `setup.exe` file to the root of the C drive, i.e. `C:\setup.exe`.
- Go to [config.office.com](https://config.office.com/deploymentsettings)
- If you want Retail Office then select `Microsoft 365 Apps for enterprise` in the office suites section.
- If you want Volume Office then select `Office LTSC Professional Plus 2021 - Volume License` in the office suites section. (Don’t select the SPLA version)
- You can add Visio and Project apps if you need them. Don’t select language that is [not available for Project/Visio](https://massgrave.dev/office_c2r_links.html) if you are installing those apps.
- Customize other things and leave settings as default if you don’t understand something.
- Once you go through all the options, click on the export button, select “Keep Current Settings” option and it will download a file named `Configuration.xml`
- Copy the downloaded `Configuration.xml` file to the root of the C drive, i.e. `C:\Configuration.xml`
- Open the command prompt as admin and run the below commands
    
    ```
    cd /
    .\setup.exe /configure .\Configuration.xml
    ```

</div>It will now download and install Office. You can activate it with your preferred method.

<div class="section level2" id="bkmrk-">---

</div><div class="section level2" id="bkmrk--1"><div data-unique="Alternative_Methods" name="Alternative_Methods"></div></div>## Alternative Methods

<div class="section level2" id="bkmrk-yaoctru%C2%A0%28office-down">- [YAOCTRU](https://github.com/abbodi1406/WHD/raw/master/scripts/YAOCTRU_v9.0.zip) (Office Downloader) &amp; [YAOCTRI](https://github.com/abbodi1406/WHD/raw/master/scripts/YAOCTRI_v10.7.zip) (Office Installer)
- [Office Tool Plus](http://otp.landian.vip/)

</div>

# Install KMS on docker compose

## Deploying pyKMS Using Docker-compose

Firstly, it’s worth mentioning that while pyKMS can activate any license without question, it’s not intended for use with unlicensed copies of Windows. Your organization should legally own the licenses for all Windows instances that you intend to activate with pyKMS.

### Prerequisites

To deploy pyKMS using Docker-compose, you need:

1. [Docker ](https://itprotutorials.com/the-power-of-docker-and-docker-compose-a-deep-dive/)installed on your machine.
2. [Docker-compose](https://itprotutorials.com/the-power-of-docker-and-docker-compose-a-deep-dive/) installed on your machine.

### Steps to Deploy

- Create a directory for your docker-compose.yml file: `mkdir py-kms`
- Navigate to the new directory: `cd py-kms`
- Open your text editor and create a docker-compose.yml file. This file defines your services, networks, and volumes. Populate it as follows:

```
version: '3'
services:
  kms:
    image: ghcr.io/py-kms-organization/py-kms:python3
    ports:
      - 1688:1688
      - 8080:8080
    environment:
      IP: "::"
      HWID: RANDOM
      LOGLEVEL: INFO
      NTP_SERVERS: 0.fr.pool.ntp.org
      TZ: Europe/Paris
    restart: always
    volumes:
      - ./db:/home/py-kms/db
      - /etc/localtime:/etc/localtime:ro
```

- Save the docker-compose.yml file and exit your text editor.
- Execute the Docker-compose command: `docker-compose up -d`

You’ve now deployed your pyKMS server using Docker-compose! The server will auto-start every time your machine boots, thanks to the `restart: always` command.

# Manually Activate Windows 11 (Enterprise) on KMS Server

Enter the licence key [Pi-KMS Product](http://pi-kms.readinfo.lan:8080/products)

```
slmgr /ipk <WINDOWS_ACTIVATION_KEY>
```

Enter the kms server

```
slmgr /skms <Name[:1688]>
```

And active your Windows

```
slmgr /ato
```