Prior to the upgrade, we had two customized join_domain_and_OU.vbs scripts that worked as a charm. Only issue was that it's coulnd't overwrite existing computer account. However, since the upgrade to the current version, they haven't been working. I've tried running them AND the default (kace-native) join_domain.vbs script manually from command line and it's not working either. The computer account is never created and there is no errors when running the script. I've tried with other admin user accounts but still no luck. Anyone else go this problem? Can the script be run in verbose mode somehow?

Best Regards,


Answer Summary:
0 Comments   [ - ] Hide Comments


Please log in to comment

Answer this question or Comment on this question for clarity



do you have cscript in front of the command?

I had to add that to my post tasks when I went from 3.5 to 3.6

cscript.exe c:\windows\w2d\join_domain.vbs tmccacad.tmcc.edu domainuser password

Answered 04/23/2014 by: SMal.tmcc
Red Belt

Please log in to comment

No, not in the kace tasks. I will add it, but still, they don't seem to work when run manually from command line (with cscript in front).

Answered 04/23/2014 by: szo850
Purple Belt

  • is your post task a windows script or a bat script file?
    • It's an "application" task, duplicated from the "Example: Join Domain and OU" task a while back. It's been edited so some of the parameters are actually inside the script. Do you want me to post it?
      • if you look at the xml code it is trying to call it like an exe. change it to a batch script and use the command I gave you.
        cscript.exe c:\windows\w2d\join_domain.vbs tmccacad.tmcc.edu domainuser password
        Cory commented that the new windows script task will do vb files but does not pass parameters so do not use that one.
    • Can't reply on your post below. I will try that, that you. But do I really need to specify the path? The vbs is located within the post-installation task.
      • I copied it locally in my images so that way I did not have to upload it as a dependancy, that is why I have the path to the c drive.

        I have one big post bat script I run:

        net start w32time

        %SystemRoot%\system32\w32tm /config /update /manualpeerlist:tmccacad.tmcc.edu /syncfromflags:manual

        start /wait net user administrator /active:yes
        start /wait net localgroup administrators f13master /add
        Start /wait net user administrator password

        reg.exe add "HKLM\SYSTEM\CurrentControlSet\services\HECI" /v DisplayName /d "Intel(R) ManagementEngineInterface" /f
        reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" /v AutoAdminLogon /d 1 /f
        reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" /v AutoLogonCount /t REG_DWORD /d 3 /f
        reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" /v DefaultDomainName /d tmccacad /f
        reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" /v DefaultUserName /d installer /f
        reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" /v DefaultPassWord /d password /f
        reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Enviroment" /v LSFORCEHOST /d ms-vdf.tmccacad.tmcc.edu /f
        reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" /v Userinit /d "C:\Windows\system32\KUsrInit.exe," /f

        del C:\Users\Default\AppData\Local\Microsoft\Windows\webcache\*.* /f /q
        del C:\Users\Default\AppData\Local\Microsoft\Windows\*.log1 /f /q /a:hs
        del C:\Users\Default\AppData\Local\Microsoft\Windows\*.log2 /f /q /a:hs
        del C:\Users\Default\AppData\Local\Microsoft\Windows\*.blf /f /q /a:hs
        del C:\Users\Default\AppData\Local\Microsoft\Windows\*.regtrans-ms /f /q /a:hs
        del C:\Users\Default\AppData\Local\Microsoft\Windows\Explorer\*.* /f /q
        del c:\users\default\downloads\*.* /f /q /s

        "C:\Program Files\Microsoft Office\Office15\ospprearm.exe"
        cscript "c:\program files\microsoft office\office15\ospp.vbs" /act
        start /wait cscript %SystemRoot%\System32\slmgr.vbs -ATO

        start /wait msiexec /qn /i "\\\client\agent_provisioning\windows_platform\ampagent-5.5.30275-x86.msi" HOST=kbox.tmcc.edu

        net user installer /delete

        start /wait cscript.exe c:\windows\w2d\join_domain.vbs tmccacad.tmcc.edu domainuser password

        Start /wait reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background" /v OEMBackground /t REG_DWORD /d 1 /f

        start /wait reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /v ipv6kill /d "reg.exe add \"HKLM\SYSTEM\CurrentControlSet\services\Tcpip6\Parameters\" /v DisabledComponents /t REG_DWORD /d 4294967295 /f"

        reg.exe add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce /v setrunonce2 /d "reg.exe add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce /v setrunonce1 /d \"reg.exe add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce /v policyon /d c:\windows\w2d\policy.bat\""
    • We only have scripted installations, so the script must be contained within the task. And that can't be done with the "BAT script" task. It can be done with the "Windows script" task, with no switches though. But I'm not sure of the Kace dev team's defenition of a "windows script".
      • this is from an email from Corey Serrins

        Not sure if you have seen the new task "Windows Script Task", but it will accept .vbs files (as well as javascript and other scripting languages, but not powershell (yet)). However, no parameters can be set on the vbs file using this task (yet).
      • I think you will need to rewrite the VBS file to contain all of the parameters then it will work.
      • one other idea I have is to create a mid level task to xcopy the vbs from \\ikbox\peinst\applications\3 to the Cdrive and then you can use a bat script with the needed parameters in the post tasks to run it from the local location
      • Windows Script is right there at the bottom when creating a new post-installation task. I will try to edit the file with the parameters, since that sollution seems more straight-on. I'll keep you posted.
Please log in to comment

Solved by putting the arguments inside the script, creating a "New Windows Script Task", and simply upload the edited vbs.

But I urge the Kace team to remove the default join_domain.vbs tasks in upcomming upgrades since they are obviously not working anymore. 

Thanks, guys :)

Answered 04/24/2014 by: szo850
Purple Belt

Please log in to comment