From 6ec2eb61a02f9e55ef5b8d22a5ca61ca53ca05e7 Mon Sep 17 00:00:00 2001 From: heqnx Date: Fri, 11 Jul 2025 21:55:20 +0300 Subject: added initial setup for domain controller --- ansible/scripts/join-domain.ps1 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 ansible/scripts/join-domain.ps1 (limited to 'ansible/scripts/join-domain.ps1') diff --git a/ansible/scripts/join-domain.ps1 b/ansible/scripts/join-domain.ps1 new file mode 100644 index 0000000..08c90b2 --- /dev/null +++ b/ansible/scripts/join-domain.ps1 @@ -0,0 +1,14 @@ +param +( + [string]$DomainName = "contoso.com", + [string]$Username = "Administrator", + [string]$Password = "packer" +) +$scriptName = $MyInvocation.MyCommand.Name +$logFile = "C:\$scriptName_log.txt" +Start-Transcript -Path $logFile -Append + +$p = ConvertTo-SecureString $Password -AsPlainText -Force +$c = New-Object System.Management.Automation.PSCredential($Username, $p) +Add-Computer -DomainName $DomainName -Credential $c +Stop-Transcript \ No newline at end of file -- cgit v1.2.3