DS 7.x Task to Collect Debugging Logs from Automation to SMP
Created: 12 Dec 2012 | Updated: 19 Feb 2013 | 4 comments
Below is a VBScript that can be used to collect logs from Automation to the SMP (Under NSCap by default) for review in case of imaging issues. It will work with both DS 7.1 and DS 7.5
To create the task:
- In the SMP Console, select Manage | Jobs and Tasks
- Right-click on Samples\Deployment Solution (or another folder of your choice) and choose New\Task
- Scroll to the bottom of the list, or nearly so, and select a Script Task.
- On the right, select VBScript from the drop list by Script Type.
- Copy the text from the table below and paste it into the empty text box below the drop box. Do NOT make any changes under Advanced.
- Select Save
- Read the text at the top of the task. There are a few things that you should modify for your own environment and comments for how to do so are provided in the task text:
- AdminAcct
- AdminPwd
- Prod
- LogsFolder - this one is where we will create a folder in NSCap to store the files
- (optional) storage location. This is not exposed in the top section but is later during the drive mapping. If you would prefer NOT to save these logs in NSCap, obviously, this can be modified. This is however the easiest location to find files during troubleshooting, and the files are not, in general, large enough to cause problems even over WAN links.
There are two tokens the task calls on that are important:
- NSServer. I believe that, depending on the version of the product you have, this token name may change. Be sure the token is correct.
- NOW. This is an identifier for the time stamp on the created folder so you can run it again and again (one minute apart). It will have to be created. The name of the token is NOW, and the script is Select {fn now()}
The task is complete and ready to be run.
NOTE: This task is intended to be run in automation, not in production.
NOTE: There have been some issues with mapping the drive. Let me know if you run into one.
Task Text:
Dim fso, f, WshShell, WshNetwork, oDrives, vMap, LogsFolder, NewFolder, Prod, Destination, AdminAcct, AdminPwd
'---------------------------------------------------
'
' Below are some variables you need to be aware of and customize before running this script
'
'---------------------------------------------------
AdminAcct = "YourAccount" 'Must have rights to map a drive back to NSCap
AdminPwd = "YourPassword" 'Associated password to the above account
' Prod may need to be changed to D or whatever your production drive is while in automation
' or run GHConfig which I don't yet know how to do here.
' Most Win7 Systems have a recovery partition, so Prod would be D: instead of C
Prod = "c:"
LogsFolder = "z:\AutomationLogs" 'Folder under NSCap to store the logs on the NS/SMP
'---------------------------------------------------
' End Customizations Section
'---------------------------------------------------
NewFolder = "%COMPNAME%_" & Replace("%NOW%",":","")
Destination = LogsFolder & "\" & NewFolder
Set fso = CreateObject("Scripting.FileSystemObject")
Set WshNetwork = WScript.CreateObject("WScript.Network")
vMap = "Yes"
Set oDrives = WshNetwork.EnumNetworkDrives
For i = 0 to oDrives.Count - 1 Step 2
IF oDrives.Item(i) = "Z:" THEN vMap = "No"
Next
IF vMap = "Yes" THEN WshNetwork.MapNetworkDrive "z:", "\\%NSSERVER%\NSCap", ,AdminAcct ,AdminPwd
If (fso.FolderExists(LogsFolder)) Then
Else
fso.CreateFolder(LogsFolder)
End If
fso.CreateFolder(Destination)
On Error Resume Next
fso.Copyfolder Prod & "\Windows\Panther", Destination & "\Panther" 'MiniSetup or SOI troubleshooting
fso.copyfolder "x:\Program Files\Altiris\Altiris Agent\Logs", Destination 'for DS 7.1
fso.copyfolder "x:\Program Files\Symantec\Deployment\Logs", Destination & "\Logs" 'for DS 7.5
fso.copyfile "x:\ghosterr.txt", Destination 'Ghost troubleshooting |
Comments 4 Comments • Jump to latest comment
I had to make a few fixes to the article after testing in a few "new" environments. Hope it helps. I changed the NS server token, added a note about a possible known issue I need feedback on, and included the SQL for one of the tokens.
Thomas Baird
Principal Technical Support Engineer
Endpoint Management - Deployment Sol
Thomas,
I am unable to see the entire code field in the above task, so I'm unable to copy the text to copy it since it flows off the right side of the text box. Not a big deal at the moment. This looks very useful for an issue that we're currently having with one of our site servers.
were you able to make this work? I did not see your post - terribly sorry. The text actually wraps when I look at it. If you're not seeing it wrap, maybe try a different browser - like IE? Maybe the community has some limitations for browser support. Again, on my screen, it wraps.
Thomas Baird
Principal Technical Support Engineer
Endpoint Management - Deployment Sol
Haven't had a chance to try it anyway. Ended up viewing it in Firefox, and it does wrap. In IE 10, it doesn't wrap. Thanks for checking back.
Would you like to reply?
Login or Register to post your comment.