Skip to content

Commit 7933255

Browse files
authored
add msiexec exit code and log file params (#28884)
* add msiexec exit code and log file params * replace markdown block with code-block * update apikey format * fix code-block alignment * clarify log file info * update msi urls * missed one
1 parent d18ea11 commit 7933255

File tree

3 files changed

+35
-20
lines changed

3 files changed

+35
-20
lines changed

content/en/agent/basic_agent_usage/windows.md

+15-9
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,17 @@ When the install finishes, you are given the option to launch the Datadog Agent
5858

5959
1. Open PowerShell with **Administrator** privileges.
6060
2. Run the following command to install the Datadog Agent:
61-
```powershell
62-
Start-Process -Wait msiexec -ArgumentList '/qn /i datadog-agent-7-latest.amd64.msi APIKEY="<YOUR_DATADOG_API_KEY>"'
63-
```
61+
{{< code-block lang="powershell" >}}
62+
$p = Start-Process -Wait -PassThru msiexec -ArgumentList '/qn /i https://windows-agent.datadoghq.com/datadog-agent-7-latest.amd64.msi /log C:\Windows\SystemTemp\install-datadog.log APIKEY="<DATADOG_API_KEY>"'
63+
if ($p.ExitCode -ne 0) {
64+
Write-Host "msiexec failed with exit code $($p.ExitCode) please check the logs at C:\Windows\SystemTemp\install-datadog.log" -ForegroundColor Red
65+
}
66+
{{< /code-block >}}
6467

6568
[1]: https://app.datadoghq.com/account/settings/agent/latest?platform=windows
6669
[2]: /agent/supported_platforms/?tab=windows
6770
[3]: /agent/faq/windows-agent-ddagent-user/
68-
[4]: https://s3.amazonaws.com/ddagent-windows-stable/datadog-agent-7-latest.amd64.msi
71+
[4]: https://windows-agent.datadoghq.com/datadog-agent-7-latest.amd64.msi
6972
[5]: https://app.datadoghq.com/organization-settings/api-keys
7073

7174
{{% /tab %}}
@@ -135,16 +138,19 @@ When the install finishes, you are given the option to launch the Datadog Agent
135138
2. Run the following command to install the Datadog Agent:
136139
137140
**Note:** Replace `DatadogGMSA$` with the username of your gMSA. The username **must end with a $ symbol.**
138-
```powershell
139-
Start-Process -Wait msiexec -ArgumentList '/qn /i datadog-agent-7-latest.amd64.msi APIKEY="<YOUR_DATADOG_API_KEY>" DDAGENTUSER_NAME="<YOUR_DOMAIN_NAME>\DatadogGMSA$"'
140-
```
141+
{{< code-block lang="powershell" >}}
142+
$p = Start-Process -Wait -PassThru msiexec -ArgumentList '/qn /i https://windows-agent.datadoghq.com/datadog-agent-7-latest.amd64.msi /log C:\Windows\SystemTemp\install-datadog.log APIKEY="<DATADOG_API_KEY>" DDAGENTUSER_NAME="<YOUR_DOMAIN_NAME>\DatadogGMSA$"'
143+
if ($p.ExitCode -ne 0) {
144+
Write-Host "msiexec failed with exit code $($p.ExitCode) please check the logs at C:\Windows\SystemTemp\install-datadog.log" -ForegroundColor Red
145+
}
146+
{{< /code-block >}}
141147
142148
[1]: https://app.datadoghq.com/account/settings/agent/latest?platform=windows
143149
[2]: /agent/supported_platforms/?tab=windows
144150
[3]: /agent/faq/windows-agent-ddagent-user/
145151
[4]: https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/manage/group-managed-service-accounts/group-managed-service-accounts/group-managed-service-accounts-overview#software-requirements
146152
[5]: https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/manage/group-managed-service-accounts/group-managed-service-accounts/getting-started-with-group-managed-service-accounts
147-
[6]: https://ddagent-windows-stable.s3.amazonaws.com/installers_v2.json
153+
[6]: https://windows-agent.datadoghq.com/installers_v2.json
148154
149155
{{% /tab %}}
150156
{{< /tabs >}}
@@ -200,7 +206,7 @@ If you're upgrading from a Datadog Agent version < 5.12.0, first upgrade to a mo
200206
201207
#### Installation log files
202208
203-
You can find Agent installation log files at `%TEMP%\MSI*.LOG`.
209+
Set the `/log <FILENAME>` msiexec option to configure an installation log file. If this option is not set, msiexec writes the log to `%TEMP%\MSI*.LOG` by default.
204210
205211
#### Validation
206212

content/en/agent/guide/fips-agent.md

+8-5
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,16 @@ The Datadog FIPS Agent is in Preview and has not been fully audited. Install and
8989
The Datadog FIPS Agent is in preview and has not been fully audited. Install and test the Agent only on hosts that are not critical to production workloads.
9090
9191
1. Follow the [Windows instructions][1] to uninstall the Datadog Agent.
92-
1. Run the command below to install the FIPS Agent, replacing `MY_API_KEY` with your API key:
92+
1. Run the command below to install the FIPS Agent, replacing `DATADOG_API_KEY` with your API key:
9393
9494
**Note:** FIPS support is only available on Agent versions 7.63.0 and above:
9595
96-
```powershell
97-
Start-Process -Wait msiexec -ArgumentList '/qn /i "https://s3.amazonaws.com/ddagent-windows-stable/beta/datadog-fips-agent-7.63.0-rc.7-fips-preview-2.msi" APIKEY="MY_API_KEY" SITE="ddog-gov.com"'
98-
```
96+
{{< code-block lang="powershell" >}}
97+
$p = Start-Process -Wait -PassThru msiexec -ArgumentList '/qn /i https://windows-agent.datadoghq.com/datadog-fips-agent-7.64.3.msi /log C:\Windows\SystemTemp\install-datadog.log APIKEY="<DATADOG_API_KEY>" SITE="ddog-gov.com"'
98+
if ($p.ExitCode -ne 0) {
99+
Write-Host "msiexec failed with exit code $($p.ExitCode) please check the logs at C:\Windows\SystemTemp\install-datadog.log" -ForegroundColor Red
100+
}
101+
{{< /code-block >}}
99102
100103
To install a different preview version of the FIPS Agent, search the [list of stable Agent versions][2] for `datadog-fips-agent` and replace the MSI in the command above with your desired version.
101104
@@ -111,7 +114,7 @@ The Datadog FIPS Agent is in preview and has not been fully audited. Install and
111114
**Note**: The program name for the FIPS Agent in **Add or Remove Programs** is "Datadog FIPS Agent."
112115
113116
[1]: /agent/basic_agent_usage/windows/#uninstall-the-agent
114-
[2]: https://s3.amazonaws.com/ddagent-windows-stable/beta/installers_v2.json
117+
[2]: https://windows-agent.datadoghq.com/installers_v2.json
115118
116119
{{% /tab %}}
117120
{{< /tabs >}}

content/en/agent/guide/windows-agent-ddagent-user.md

+12-6
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,12 @@ If a user account is specified on the command line, but this user account is not
3434

3535
To specify the optional USERNAME and PASSWORD on the command line, pass the following properties to the `msiexec` command (The bracket `<>` characters indicate a variable that should be replaced):
3636

37-
```shell
38-
msiexec /i ddagent.msi DDAGENTUSER_NAME=<USERNAME> DDAGENTUSER_PASSWORD=<PASSWORD>
39-
```
37+
{{< code-block lang="powershell" >}}
38+
$p = Start-Process -Wait -PassThru msiexec -ArgumentList '/qn /i https://windows-agent.datadoghq.com/datadog-agent-7-latest.amd64.msi /log C:\Windows\SystemTemp\install-datadog.log APIKEY="<DATADOG_API_KEY>" DDAGENTUSER_NAME="<USERNAME>" DDAGENTUSER_PASSWORD="<PASSWORD>"'
39+
if ($p.ExitCode -ne 0) {
40+
Write-Host "msiexec failed with exit code $($p.ExitCode) please check the logs at C:\Windows\SystemTemp\install-datadog.log" -ForegroundColor Red
41+
}
42+
{{< /code-block >}}
4043

4144
Requirements:
4245
* The username must be 20 characters or fewer to comply with Microsoft's [Active Directory Schema (AD Schema) SAM-Account-Name attribute][1].
@@ -63,9 +66,12 @@ If a user account is specified on the command line, but this user account is not
6366

6467
To specify a username from a domain account, use the following form for the `DDAGENTUSER_NAME` property:
6568

66-
```shell
67-
msiexec /i ddagent.msi DDAGENTUSER_NAME=<DOMAIN>\<USERNAME> DDAGENTUSER_PASSWORD=<PASSWORD>
68-
```
69+
{{< code-block lang="powershell" >}}
70+
$p = Start-Process -Wait -PassThru msiexec -ArgumentList '/qn /i https://windows-agent.datadoghq.com/datadog-agent-7-latest.amd64.msi /log C:\Windows\SystemTemp\install-datadog.log APIKEY="<DATADOG_API_KEY>" DDAGENTUSER_NAME="<DOMAIN>\<USERNAME>" DDAGENTUSER_PASSWORD="<PASSWORD>"'
71+
if ($p.ExitCode -ne 0) {
72+
Write-Host "msiexec failed with exit code $($p.ExitCode) please check the logs at C:\Windows\SystemTemp\install-datadog.log" -ForegroundColor Red
73+
}
74+
{{< /code-block >}}
6975

7076
The `<DOMAIN>` can either be a fully-qualified domain name (in the form `mydomain.com`) or the NETBIOS name (the pre-Windows 2000 name).
7177
It must be separated from the `<USERNAME>` with a backslash `\`.

0 commit comments

Comments
 (0)