summaryrefslogtreecommitdiff
path: root/ansible/scripts/join-domain.ps1
diff options
context:
space:
mode:
authorheqnx <root@heqnx.com>2025-07-11 21:55:20 +0300
committerheqnx <root@heqnx.com>2025-07-11 21:55:20 +0300
commit6ec2eb61a02f9e55ef5b8d22a5ca61ca53ca05e7 (patch)
treed975569e35991a02c73706ce81c0fc1f2e92405c /ansible/scripts/join-domain.ps1
parent742fa0d51cd384ea3d856438861bb86738fdabb8 (diff)
downloadansible-active-directory-range-6ec2eb61a02f9e55ef5b8d22a5ca61ca53ca05e7.tar.gz
ansible-active-directory-range-6ec2eb61a02f9e55ef5b8d22a5ca61ca53ca05e7.zip
added initial setup for domain controller
Diffstat (limited to 'ansible/scripts/join-domain.ps1')
-rw-r--r--ansible/scripts/join-domain.ps114
1 files changed, 14 insertions, 0 deletions
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