Invoke - Join Active Directory Domain - Windows - superseded
Log In or Register to download the BES file, and more.

0 Votes

Versioning - This is an older version.

1Invoke - Join Active Directory Domain - Windows8/17/2016 3:31:47 PM
2Invoke - Join Active Directory Domain - Windows8/18/2016 7:10:08 AM
3Invoke - Join Active Directory Domain - Windows8/18/2016 7:26:22 AM
4Invoke - Join Active Directory Domain - Windows8/18/2016 7:35:04 AM
5Invoke - Join Active Directory Domain - Windows2/1/2017 7:23:43 PM
6Invoke - Join Active Directory Domain - Windows2/6/2017 9:44:56 AM

Description

Securely Domain Join a Windows Computer!

For general information or to report issues with C3 Inventory content please visit GitHub here: https://github.com/strawgate/C3-Inventory


Property Details

ID23383
TitleInvoke - Join Active Directory Domain - Windows
DomainBESC
Source Release Date5/7/2016 12:00:00 AM
Added by on 2/1/2017 7:23:43 PM
Last Modified by on 2/1/2017 7:23:43 PM
Counters 824 Views / 24 Downloads
User Rating 1 star 2 star 3 star 4 star 5 star * Average over 0 ratings. ** Log In or Register to add your rating.

Relevance

isWindows (Relevance 1172)
Used in 1112 fixlets and 524 analyses   * Results in a true/false
Show indented relevance
windows of operating system
Used in 2 fixlets   * Results in a true/false
Show indented relevance
string value of select "Domain from Win32_ComputerSystem" of wmi as lowercase = "workgroup"

Actions

Action 1

Action Link Click here to deploy this action.
Script Type BigFix Action Script
parameter "PowerShellExe"="{ pathname of file ((it as string) of value "Path" of key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell" of native registry) }"

delete __createfile
delete powershell.ps1

createfile until _end_
param (
    $Username,
    $Password
)

$domain = "{parameter "ADDomain" of action}"
$OU = "{(concatenations "," of substrings separated by ";" of it) of parameter "ADOU" of action}"

$password = $Password | ConvertTo-SecureString -asPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential($username,$password)

#Try Domain Join with OU -- will fail if object already exists
Add-Computer -DomainName $domain -Credential $credential -OUPath $OU -force -ErrorAction silentlycontinue

#Try Domain Join without OU
Add-Computer -DomainName $domain -Credential $credential -force
_end_

move __createfile powershell.ps1

waithidden "{parameter "PowershellExe"}" -ExecutionPolicy Bypass -File powershell.ps1 -Username "{parameter "ADUser" of action}" -Password "{parameter "ADPwd" of action}"

action requires restart
Success Criteria

This action will be considered successful when the applicability relevance evaluates to false.


Sharing

Social Media:
Share this page on Yammer

Comments

Log In or Register to leave comments!