8000 chore: add admin username · coder/modules@b93471a · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Commit b93471a

Browse files
committed
chore: add admin username
1 parent 53083a5 commit b93471a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

windows-rdp/main.tf

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ variable "resource_id" {
1919
description = "The ID of the primary Coder resource (e.g. VM)."
2020
}
2121

22+
variable "admin_username" {
23+
type = string
24+
default = "Administrator"
25+
}
26+
2227
variable "admin_password" {
2328
type = string
2429
default = "coderRDP!"
@@ -35,9 +40,9 @@ resource "coder_script" "windows-rdp" {
3540
[string]$adminPassword
3641
)
3742
# Set admin password
38-
Get-LocalUser -Name "Administrator" | Set-LocalUser -Password (ConvertTo-SecureString -AsPlainText $adminPassword -Force)
43+
Get-LocalUser -Name "${var.admin_username}" | Set-LocalUser -Password (ConvertTo-SecureString -AsPlainText $adminPassword -Force)
3944
# Enable admin user
40-
Get-LocalUser -Name "Administrator" | Enable-LocalUser
45+
Get-LocalUser -Name "${var.admin_username}" | Enable-LocalUser
4146
}
4247
4348
function Configure-RDP {

0 commit comments

Comments
 (0)
0