Can't get my scripts (bat and Powershell) to work.
Hello,
I'm using Kace 2000 to deploy Windows 10 on Workstations. I've created some scripts that run perfectly when i click them as an "administrator" on a workstation but they don't work when i want to use them as a post installation task in Kace.
Let's take an example.
I create this PowerShell Script to join my domain:
$user = abc@mydomain.fr
$pass = ConvertTo-SecureString "mypassword" -AsPlainText -Force
$DomainCred = New-Object System.Management.Automation.PSCredential $user, $pass
Add-Computer -DomainName mydomain.fr -Credential $DomainCred -Restart -Force
Unfortunely, in order to make it work, i need elevated privilege, so i created the following script who will run the .ps1 script:
Powershell -NoProfile -ExecutionPolicy Bypass -Command "& {Start-Process Powershell -ArgumentList '-NoProfile -ExecutionPolicy Bypass -File ""c:\script\join_domain.ps1""' -Verb RunAs}"
As i said, when i click the .bat on the desktop, it works. But as soon as i want to create a post installation task, Nothing happens
I have the same problem with all my scripst like a basic one who remove the administrator after the isntallation (i have the "french" administrateur account).
Do you guys have any idea about how to make my script to work?
Regards,
David.
Answers (3)
Hi,
Sorry for the late reply. My problem's still here. In fact, it looks like the issue is more important than i thought. I've decided to run a test with a very basic script : "mkdir c:\test\" (or Something) and it doesn't work.
All of my post installation tasks don't work and i don't even find a log file that tells me "why".
Could it be possible that the problem would be my Appliance?
I'm running Dell Kace 2000 version 3.7.120345.
Also i've noticed that Kace doesn't clean up the system after the installation. if i go to c: i can see a "KACE" folder with a lot of subfolders. In some of them i can find my bat files who will work if i click them.
Any idea?
Regards,
David.
Comments:
-
I too am having the same problem with my pre/post installation task. - gerroe 7 years ago