SCCM client install script

By | October 21, 2011

I was recently on a site where I had a requirement to install the SCCM client on a number of workgroup pc’s.  The client wanted to allow the end users on the PC’s to install the SCCM client themselves so needed a method to map a drive to a share where the SCCM client files were and then start the installation.

I wrote a simple VBScript that mapped a drive to the client share passing the required logon credentials and then started the SCCM client install.  So that the end user couldn’t see the username and password within the script, I passed it through the windows script encoder tool wich gave me a .vbe file.

 

‘############ Start of Script #################

Dim fso
Set fso = CreateObject(“Scripting.FileSystemObject”)
set shell = CreateObject(“wscript.shell”)
Set objNetwork = CreateObject(“WScript.Network”)

strDriveLetter = “Z:”
strRemotePath = “\\Servername.FQDN\client
strUser = “Domain\username”
strPassword = “Password”
strProfile = “False”

‘Map Network Driver
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath, strProfile,  strUser, strPassword

‘wscript.echo “Install the SCCM Client.”
command = “Z:\ccmsetup.exe smsslp=SLPServer.FQDN smsmp=MPServer.FQDN SMSSITECODE=XXX”
x = shell.run(command,0,true)

‘############ End of Script #################

You can download the Windows Script Encoder from here

Leave a Reply

Your email address will not be published. Required fields are marked *