Powershell script won`t start through K2000 ?!
I want to run a PS-script trough K2000 after Windows 7-installtion is done. The script will join PC to the domain. But nothing happen, script should work, have test i manually.
Script looks like this:
$domain = "company"
$password = "password" | ConvertTo-SecureString -asPlainText -Force
$username = "$company.local\admin"
$credential = New-Object System.Management.Automation.PSCredential($username,$password)
Add-Computer -DomainName $domain -Credential $credential
In K2000 looks like this:
|Created:||Ons, 4 Jun 2014 11:28:06|
|Modified:||Ons, 4 Jun 2014 13:33:18|
command line is : powershell.exe -nologo -executionpolicy bypass -WindowStyle hidden -noprofile -file "domain.ps1"