This Vbs script will take a list of machine names from a text file called MachineList.txt and create CCR files for each of them using the minimum information required to successfully create an NT client configuration request.
It will then copy the CCR files to the specified Site server and then delete the original files from the directory in which the script is executed from.
Note: Change all occurrences of C:\Temp\ to the directory in which the script is executed from.
Vbs Script
InputFile = "MachineList.Txt"
strSiteServer = InputBox("Enter Site Server Name")
strSiteCode = InputBox("Enter Site Code")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(InputFile)
Do While Not (objFile.AtEndOfStream)
MachineName = objFile.ReadLine
Set Output = objFSO.CreateTextFile(MachineName & ".Ccr", True)
'Create CCR Files
Output.WriteLine("[NT Client Configuration Request]")
Output.WriteLine(" Client Type=1")
Output.WriteLine(" Forced CCR=TRUE")
Output.WriteLine(" Machine Name=" & MachineName)
Output.Close
Loop
'Copy CCR Files
On Error Resume Next
Const OverwriteExisting = True
objFSO.CopyFile "C:\Temp\*.ccr" , "\\" & strSiteServer & "\SMS_" & strSiteCode & "\Inboxes\Ccr.Box\", OverwriteExisting
If Err.Number <> 0 Then
Wscript.Echo "Error: " & Err.Number & " " & Err.Description
Wscript.Quit Err.Number
Else
'Delete CCR Files
objFSO.DeleteFile("C:\Temp\*.ccr")
End If
Wscript.Echo "Done"
This VBS script will allow you to enter an Advanced client resource machine name into an input dialog