Task sequence Run As
Hello, I have created a task sequence that runs a command line. The command line is a created vb script that uses arguments. In the task sequence I use the scriptname_version.vbs /argument1 /argument2. I use a specific package that contains the vbscript and set no working dir. I also use the Run as specific user feature. The script adds the computer record to a specific collection in SCCM through WMI. Now if I advertise the task sequence to a computer all works , wether or not a user is logged on the task sequence executes correctly and the record is added to the collection. But, if I use the same task in my OSD task sequence then I have an error 1 incorrect function. If I compare the smsts.log files then the only difference that I see is the line : Get RunAs private desktop SMSTS. This part is executed when running in OSD and not when executed from a normal TS. Any suggestions ? As a workaround I thought I could create the WMI connection with a specific username / password in order not to have to use the Run as specific user feature.
May 23rd, 2011 2:55pm

This is an example of how I did it (but then with removing): http://www.petervanderwoude.nl/post/configmgr-2007-and-removing-a-computer-from-a-collection-by-script My Blog: http://www.petervanderwoude.nl/
Free Windows Admin Tool Kit Click here and download it now
May 23rd, 2011 3:30pm

Hi, Where in the task sequence are you running it? If you still are in WinPE the Runas doesn't work. /Jörgen-- visit my System center blog at http://ccmexec.com --
May 23rd, 2011 4:58pm

Please run the script after installing the system. Many commands and APIs for Windows clients cannot be recognized in WinPE.Please remember to click Mark as Answer on the post that helps you, and to click Unmark as Answer if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Free Windows Admin Tool Kit Click here and download it now
May 25th, 2011 5:13am

I used a web service to do this, Maik Koster has written one, works great. http://mdtcustomizations.codeplex.com/ Louis
May 25th, 2011 5:44am

Hello, The solution was to use a specific username/password for the WMI connection in stead of a RunAs account. I create variables in the TS for the username / password and read these in the VB script so no hardcoded usernames or passwords are in the script. However I had a second issue when using this script in the task sequence advertised to the unknown computers collection. During the execution of the script the vbs could not find the resource record with the specific computername because the resource record is still marked as unknown. So the solution was to modify the query so the MAC address gets queried and not the computername, this led to a working solution. Kind regs Gino D
Free Windows Admin Tool Kit Click here and download it now
May 30th, 2011 4:35pm

Hello, The solution was to use a specific username/password for the WMI connection in stead of a RunAs account. I create variables in the TS for the username / password and read these in the VB script so no hardcoded usernames or passwords are in the script. However I had a second issue when using this script in the task sequence advertised to the unknown computers collection. During the execution of the script the vbs could not find the resource record with the specific computername because the resource record is still marked as unknown. So the solution was to modify the query so the MAC address gets queried and not the computername, this led to a working solution. Kind regs Gino D
May 30th, 2011 4:35pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics