Add computer to security group during task sequence
Hi guys, having an issue at the moment where I am trying to add a computer to a security group during a task sequence. I have used the folloing script which is great
http://ccmexec.com/2010/08/adding-computer-to-ad-groups-during-deployment/
I know that the script works fine when running the task sequence from directly within the Operating System (after it is built from within Software Center). I know this to not be a persmissions issue. The service account has permissions to add computers to
this security group
However having an issue when trying to use this command line during my standard x86 deploy tasks sequence. I am running this command line right at the end of the task sequence so by this stage it is not in WinPE and is after the operating system is
laid down
wscript.exe Add-group.vbs SEC_IS_DA_Clients
The error that I am getting is as follows
wnloaded at C:\_SMSTaskSequence\Packages\P01001F1
Resolved source to 'C:\_SMSTaskSequence\Packages\P01001F1'
Command line for extension .exe is "%1" %*
Replacing wscript.exe with cscript.exe
Command line for extension .vbs is "C:\WINDOWS\System32\CScript.exe" "%1" %*
Set command line: Run command line
Working dir 'C:\_SMSTaskSequence\Packages\P01001F1'
Executing command line: Run command line
Create a process under given user token
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.
Process completed with exit code 1
CScript Error: Can't find script engine "VBScript" for script "C:\_SMSTaskSequence\Packages\P01001F1\Add-group.vbs".
Command line returned 1
Entering ReleaseSource() for C:\_SMSTaskSequence\Packages\P01001F1
reference count 1 for the source C:\_SMSTaskSequence\Packages\P01001F1 before releasing
Delete source directory C:\_SMSTaskSequence\Packages\P01001F1
Released the resolved source C:\_SMSTaskSequence\Packages\P01001F1
Any ideas why this would work from within the OS fine (whilst kicking off from within software center) but not when running during my deploy task sequence?
Thanks
***Note this is SCCM 2012 question, not sure how to change category in the forums***
August 22nd, 2012 7:48pm
"CScript Error: Can't find script engine "VBScript" for script"
Try moving this step to run immediately after the 'Setup Windows and ConfigMgr' task sequence step rather than executing it at the end
of your task sequence. I've had the same issue with vbscripts that manipulate AD objects running later in the task sequence (during a refresh scenario too!) however they seem to execute successfully right after the machine has completed minisetup and joined
the domain.
Free Windows Admin Tool Kit Click here and download it now
August 23rd, 2012 4:30am
"CScript Error: Can't find script engine "VBScript" for script"
Try moving this step to run immediately after the 'Setup Windows and ConfigMgr' task sequence step rather than executing it at the end
of your task sequence. I've had the same issue with vbscripts that manipulate AD objects running later in the task sequence (during a refresh scenario too!) however they seem to execute successfully right after the machine has completed minisetup and joined
the domain.
August 23rd, 2012 4:38am
Cheers, I will give this a try and let you know the result
Free Windows Admin Tool Kit Click here and download it now
August 23rd, 2012 7:44pm
Cheers, I will give this a try and let you know the result
August 23rd, 2012 7:52pm
I am getting the exact same message when running directly after Setup Windows and ConfigMgr step.
Free Windows Admin Tool Kit Click here and download it now
August 23rd, 2012 11:32pm
I am getting the exact same message when running directly after Setup Windows and ConfigMgr step.
August 23rd, 2012 11:40pm
Hi Nick,
I have seen this error many times, and found a resolved thread which talk much about this error in OSD you can take a reference:
http://social.technet.microsoft.com/Forums/en/configmgrosd/thread/223fa6ab-7d39-4494-a4cf-d1320095a1e0
Inside this thread following solutions maybe work for different environments with same error:
re-register vbscript.dll: "regsvr32 /s %SystemRoot%\System32\vbscript.dll"set: REG ADD HKLM\SOFTWARE\Microsoft\COM3 /v REGDBVersion /t REG_BINARY /d 010000 /f
If this works then probably the solution would be to export the reg key before running the script and set a value as 1 and then again restore it backbecause of UAC, add runas to your command: Runas /profile /user:fabrikam\kenmyer "cscript.exe \"C:\Documents and Settings\kenmyer\Scripts\test.vbs"
Hope this will help.
Thanks
Free Windows Admin Tool Kit Click here and download it now
August 24th, 2012 3:15am
Since this is SCCM 2012 I would also suggest posting here (For SCCM 2012) :
http://social.technet.microsoft.com/Forums/en-us/category/systemcenter2012configurationmanager
August 24th, 2012 9:41am
Since this is SCCM 2012 I would also suggest posting here (For SCCM 2012) :
http://social.technet.microsoft.com/Forums/en-us/category/systemcenter2012configurationmanager
Free Windows Admin Tool Kit Click here and download it now
August 24th, 2012 9:53am
If you are looking to do AD activities, you will need to integrate ADSI into your WinPE image. I don't have a link to the instructions, but there is a "driver" file that will import the necessary components. Otherwise, you can do AD activities after the
Setup Windows and ConfigMgr step in your OSD Task Sequence. After that, you are running in Windows (and not WinPE) and it should have access to AD etc. Hope this helps.
August 24th, 2012 10:03am
If you are looking to do AD activities, you will need to integrate ADSI into your WinPE image. I don't have a link to the instructions, but there is a "driver" file that will import the necessary components. Otherwise, you can do AD activities after the
Setup Windows and ConfigMgr step in your OSD Task Sequence. After that, you are running in Windows (and not WinPE) and it should have access to AD etc. Hope this helps.
Free Windows Admin Tool Kit Click here and download it now
August 24th, 2012 10:14am
Looks like the fix,
http://blogs.technet.com/b/deploymentguys/archive/2012/04/24/run-command-line-as-domain-user-incorrect-function-error.aspx
Suspected this is because we have .NET 1.1 install in our image. Changes this registry key
Thanks guys
August 24th, 2012 1:54pm
Looks like the fix,
http://blogs.technet.com/b/deploymentguys/archive/2012/04/24/run-command-line-as-domain-user-incorrect-function-error.aspx
Suspected this is because we have .NET 1.1 install in our image. Changes this registry key
Thanks guys
Free Windows Admin Tool Kit Click here and download it now
August 24th, 2012 2:06pm