When ConfigMgr 2012 is integrated with MDT 2012, the Client Task Sequence template includes a step that uses ZTIMoveStateStore.wsf to move the StateStore folder to WINDOWSTEMP in the event of success or failure, however this script has not been updated to cater for the new location of the StateStore and when it runs it will simply not find the StateStore in the expected location and exit without any error. This isn’t too much of a problem until you attempt a second refresh of a system -which will result in the Task Sequence failing to store the user state.
To rectify this, create a backup copy of the ZTIMoveStateStore.wsf script within the MDT Toolkit Files package and then open the original for editing. You will be looking for any references to “oUtility.LocalRootPath” and replace these with “oUtility.StatePath” and remove the additional path. There are 6 (SIX) lines to which this amendment needs to be made;
– 1 –
If oFSO.FolderExists(oUtility.LocalRootPath & "StateStore") Then
becomes
If oFSO.FolderExists(oUtility.StatePath) Then
– 2 –
oLogging.CreateEntry "Moving " & oUtility.LocalRootPath & "StateStore" & " to " & sArchiveDir & "StateStore", LogTypeInfo
becomes
oLogging.CreateEntry "Moving " & oUtility.StatePath & " to " & sArchiveDir & "StateStore", LogTypeInfo
– 3 –
oFSO.MoveFolder oUtility.LocalRootPath & "StateStore", sArchiveDir & "StateStore"
becomes
oFSO.MoveFolder oUtility.StatePath, sArchiveDir & "StateStore"
– 4 –
oLogging.CreateEntry "Error moving " & oUtility.LocalRootPath & "StateStore" & " to " & sArchiveDir & "StateStore: " & Err.Description & " (" & Err.Number & "). Trying to copy", LogTypeWarning
becomes
oLogging.CreateEntry "Error moving " & oUtility.StatePath & " to " & sArchiveDir & "StateStore: " & Err.Description & " (" & Err.Number & "). Trying to copy", LogTypeWarning
– 5 –
OFSO.CopyFolder oUtility.LocalRootPath & "StateStore", sArchiveDir & "StateStore"
becomes
OFSO.CopyFolder oUtility.StatePath, sArchiveDir & "StateStore"
– 6 –
oLogging.CreateEntry "Error Copying " & oUtility.LocalRootPath & "StateStore" & " to " & sArchiveDir & "StateStore: " & Err.Description & " (" & Err.Number & "). Trying to copy", LogTypeWarning
becomes
oLogging.CreateEntry "Error Copying " & oUtility.StatePath & " to " & sArchiveDir & "StateStore: " & Err.Description & " (" & Err.Number & "). Trying to copy", LogTypeWarning
This has worked great for me.
Recent Comments