In some scenarios you need to install the SCCM client using another Software Distribution tool than Configuration Manager, yes I know it sounds strange ;-)

If you have tried this you know that the Ccmsetup.exe installs a service and the exits in the user context so that control is returned to the vbscript, cmd file or whatever method you use to run Ccmsetup.

There are two ways of solving this:

1. Run Ccmsetup.exe with the /noservice switch then ccmsetup runs the setup in the user with which you triggered the installation and not using  a service in System context.

2.Use vbscript that checks for an active process called “ccmsetup.exe” and wait for it to exit.

I thought of writing a script for this and then I found this excellent discussion on a forum: http://www.tek-tips.com/viewthread.cfm?qid=911251

That script will work for Ccmsetup as well. Below is the modified script for ccmsetup.exe

Set WshShell = Nothing
Set WshShell = WScript.CreateObject(“WScript.Shell”)
WshShell.Run “ccmsetup.exe SMSSITECODE=020 FSP=SCCM01”, 0, True
Wscript.Sleep 5000
set svc=getobject(“winmgmts:root\cimv2″)
sQuery=”select * from win32_process where name=’ccmsetup.exe'”
set cproc=svc.execquery(sQuery)
iniproc=cproc.count
Do While iniproc = 1
wscript.sleep 5000
set svc=getobject(“winmgmts:root\cimv2″)
sQuery=”select * from win32_process where name=’ccmsetup.exe'”
set cproc=svc.execquery(sQuery)
iniproc=cproc.count
Loop
set cproc=nothing
set svc=nothing
Set WshShell = Nothing

Thanks

Suggested Posts:

Leave a Reply