Powershell script won`t start through K2000 ?!
Hi!
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
restart-computer
In K2000 looks like this:
Name: | |
Type: | Application |
Runtime Environment: | |
Created: | Ons, 4 Jun 2014 11:28:06 |
Modified: | Ons, 4 Jun 2014 13:33:18 |
Version: | 4 |
File: | domain.ps1 |
File Size: |
288 B
command line is : powershell.exe -nologo -executionpolicy bypass -WindowStyle hidden -noprofile -file "domain.ps1" |
0 Comments
[ + ] Show comments
Answers (2)
Answer Summary:
Please log in to answer
Posted by:
dugullett
10 years ago