Tuesday, October 15, 2013

Batch file for the client re-install powershell from yesterday

Here is the batch file I use for the earlier powershell script to re-install the SCCM client.

NOTES:
  PSExec and CMTrace must be in the folder you launch this from 'MyScripts' in this case.
  The powershell referenced above plus WMIRepair.exe and UnlockPowerShell.vbs must be in the
    'push' subdirectory.  I talked about UnlockPowerShell.vbs HERE.  I also have ccmclean in there
    but I don't use it anymore...
 

xcopy C:\MyScripts\push \\%1\c$\temp\push /E /I /F
psexec \\%1 -s cscript c:\temp\push\UnlockPowerShell.vbs
start "" .\cmtrace \\%1\c$\temp\sccm.log
psexec \\%1 -s powershell c:\temp\push\clifixes.ps1
psexec \\%1 -s cmd /C rmdir /s /q c:\temp\push

The command line would look like
          scriptname.bat computername

%1 in the batch files is replaced with 'computername' from the command line.

No comments:

Post a Comment