1st Code rework with parameterization

This commit is contained in:
rfost52 2021-06-18 22:57:23 -04:00
parent 8c127160de
commit 2ec37c5da9
1 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,6 @@
<#
.SYNOPSIS
Joins computer to Active Directory
Joins computer to Active Directory.
.DESCRIPTION
Computer can be joined to AD in a specific OU specified in the parameters or it will join the default location.
@ -26,7 +26,7 @@ param(
)
$username = "$domain\$UserAccount"
$credential = New-Object System.Management.Automation.PSCredential($username, $secpassword)
$credential = New-Object System.Management.Automation.PSCredential($username, $password)
if ([string]::IsNullOrEmpty($domain)) {
Write-Output "Domain must be defined. Use -domain <value> to pass it."