Friday 23 May 2014

Collecting SMSTS.log files to a remote share from a failed SCCM Task Sequence

I am going to presume that you can create a shared drive on Windows OS
You are using some kind of Virtual Machine (VM) ie Hyper-V or VMWare
Create a shared folder with accessible account, you need to connect to the root of this share.
You have some basic understanding of how to create steps within a TS
TS = Task Sequence

This process allows you to view failed OSD log files, without have to be sat waiting at a failed system.
With a new or any already created building/deploying task sequence with SCCM;

THIS IS THE IMPORTANT BIT.... if you do not do this it will not work
Create a New Group at the ROOT of the Task Sequence.

Create a New Group at the ROOT of the Task Sequence. The very first thing it does within the Task Sequence, NOTHING should be above this. This encapsulates the whole of the TS
Name it whatever you wish, but in mine I have called it;

Capture SMSTS log files
Move all the existing task sequence steps into this New Group (Capture SMSTS log files)

Next Create a New Group at the end of the exisiting Task Sequence
I called mine Send Logs as that what I wanted to do send teh logs files from a failed TS to a share I can use SCCM Trace tool

In the Options Tab within the New Group you have just created,
You need to add a TS variable,
Add Condition, Task Sequence Variable
Set the Variable to _SMSTSLastActionSucceeded
Set the Value to False

Under the Group you have just created (Send Logs)

Create a TS step;
Add, General, Connect to a network folder
Complete the mapping, path; drive and Account
 remember you must have write access to the path
I used M: as my drive letter, this will become apparent in the next steps.
Next step
Add, General, Run Command Line
enter at the Command line field, cmd /c rd /s /q m:\%_SMSTSMachineName%

Next Step
Add, General, Run Command Line
Enter at the Command line field, cmd /c md m:\%_SMSTSMachineName%

Next Step
Add, General, Run Command Line
Enter at the Command line field, cmd /c copy %_SMSTSLogPath%\*.* m:\%_SMSTSMachineName%

When the TS fails now you will have log files in the shared folder you mapped earlier....
Now you can use SCCM trace tool to actually view the failure, in a properly formatted style rather than viewing in a notepad text file.... yes I can do the text file but there is always an easier way....

Hope you found this useful....
I did not do screen grabs as you should be able to complete this fairly simply

Just as a quick test to see that you will get the logs, set the TS step Partition disk 0 to a larger disk size the than the Virtual Disk you create for your VM, say set Partition Disk 0 to 20GB when the actual VM disk is only 10GB.... this will cause the TS to fail definitely... :)

Error from within failed SMSTS.log

Partition 0 larger than remaining disk space. Requested partition size: 20401094656, remaining size: 10733990400

see.....

Friday 21 February 2014

When creating an answer file and can't remember........

When creating an answer file and can't remember........

Installing software and creating and an answer file, bear in mind not all software will work in this manner.

Install the software from a command prompt:

Run the application “whatever you are trying to automate” name; YOURAPPLICATION

YOURAPPLICATION.exe /r /f1"C:\YOURAPPLICATION.iss"

/r : Sets this to Recording mode
/f1 : is where you want to save the .iss file, this must be a specific place, yet .\YOURAPPLICATION.ISS will work

Once complete check for the existence of the .iss file, if there is no file, it would suggest that the command line syntax is incorrect.
If the file exists, uninstall the application

Now check the newly created file works by entering the following command:

YOURAPPLICATION.exe /S /f1" C:\YOURAPPLICATION.iss "
/S : silent mode
/f1 : path of the configuration file.

The above will install the application with no user input, using the information entered during the record mode.

Create uninstall for the software as per the above creation using recording mode:

YOURAPPLICATION.exe /uninst /r /f1" C:\YOURAPPLICATION.iss "

/uninst : uninstall mode
/r : recording mode
/f1 : path of the configuration file.


Now check the newly created file works by entering the following command:

YOURAPPLICATION.exe /S /uninst /f1" C:\YOURAPPLICATION.iss "
/uninst : uninstall mode
/S : Silent mode
/f1 : path of the configuration file