Log_RegisterExcludeValue
VB Scripting Library > OSD Scripting Library > Log functions (OSD)
Log_RegisterExcludeValue(sDescription,sValue)
Section titled “Log_RegisterExcludeValue(sDescription,sValue)”Registers values that should be removed from files before uploading them.
Arguments
Section titled “Arguments”| ARGUMENT | DESCRIPTION | TYPE |
|---|---|---|
| sDescription | A description of the value that is to be removed, this is added to the logfile. | String |
| sValue | The string value that should be removed | String |
Return Type
Section titled “Return Type”Boolean, TRUE if function completed successfully.
Remarks
Section titled “Remarks”Typically used in the PreBootScript.wsf
When Log_SubmitLogs uploads the files, every registered value is replaced with the text ---Value removed by script for security reasons---. The original files on the computer aren’t changed.
- The values are saved in the
ExcludeFromLogs.inifile on the WinPE system drive, so values registered in one OSD script also apply to later scripts in the same deployment. - sDescription identifies the value. If you register a new value with the same description, it replaces the previous value.
- An empty value isn’t registered.
- Sysprep_JoinDomain and Sysprep_SetLocalAdminPassword register their passwords automatically.
Example
Section titled “Example”The following example will do the following:
- Set the global variable gsLogServerFolder to a log share on the OSD server.
- Add a custom logfile is registered for submit along with the well-known logfiles.
- Register the product key as an unwanted text string that should be excluded from all files.
- Submit the logfiles.
Private Function IncludeScript(sScriptFile) '...End Function
'Begin bStatus=True If bStatus Then bStatus=IncludeScript("customlib.cis") If bStatus Then bStatus=IncludeLibrary("Capalib.cin") If bStatus Then bStatus=IncludeLibrary("Osdlib.cin") If bStatus Then bStatus=Job_Start("WS","Script Name","1.0","ScriptName.log","INSTALL") If bStatus Then bStatus=OSD_Initialize()
gsLogServerFolder="\\" & gsBootServer & "\LogFiles" 'set the log folder root sProductKey = "11111-22222-33333-44444-55555" If bStatus Then bStatus=Sysprep_SetProductKey(sProductKey)
If bStatus Then bStatus=Log_RegisterExcludeValue("Product key",sProductKey) 'remove productkey value from logfiles If bStatus Then bStatus=Log_RegisterWellKnownFiles() If bStatus Then bStatus=Log_RegisterLogfile("X:\MyTestLog.log") 'register an aditional file to submit
If bStatus Then bStatus=Log_SubmitLogs() 'submit the logs
Job_End(bStatus)'End mainSee Also
Section titled “See Also”Scripting Guidelines, Log_RegisterLogfile, Log_RegisterWellKnownFiles, Log_RemoveLogs, Log_SubmitLogs Constants Package Property Variables