1030 |
|
= |
1030 |
|
1031 |
|
|
1031 |
|
1032 |
|
|
1032 |
|
1033 |
|
|
1033 |
|
1034 |
If SetOSDV4(sVariable, sEncoded) or SetDat(sVariable, sEncoded) Then |
|
1034 |
If SetOSDV4(sVariable, sEncoded) or SetDat(sVariable, sEncoded) Then |
1035 |
oLogging.CreateEntry "Property " & sVariable & " is now = " & sNew, LogTypeInfo |
|
1035 |
oLogging.CreateEntry "Property " & sVariable & " is now = " & sNew, LogTypeInfo |
|
|
-+ |
1036 |
|
|
|
|
1037 |
|
|
|
|
1038 |
'MM: Mike Morawski (Migee.com) Per-Task Settings - ZTIUTILITY.VBS |
|
|
|
1039 |
dim curDictionary, curInnerDictionary, curDictionaryKeys |
|
|
|
1040 |
Dim aElement, aItem, i |
|
|
|
1041 |
|
|
|
|
1042 |
'If TaskSequence changes, run through and update any "pending" varialbes |
|
|
|
1043 |
If sVariable = "TaskSequenceID" And sNew <> "" Then |
|
|
|
1044 |
|
|
|
|
1045 |
'MM: Checks to see what the last active sequence was, to avoid overwriting variables on re-gathers. |
|
|
|
1046 |
oLogging.CreateEntry "MM: Last Sequence Remembered:" & oEnvironment.Item("MM_LastSequence"), LogTypeInfo |
|
|
|
1047 |
|
|
|
|
1048 |
If oEnvironment.Item("MM_LastSequence") = "" OR oEnvironment.Item("MM_LastSequence") <> sNew Then |
|
|
|
1049 |
|
|
|
|
1050 |
'Changing tasks. Pending variables *keys* stored in either Dynamic_{TASKID}_Elements and Dynamic_{TASKID}_Elements_LIST |
|
|
|
1051 |
oLogging.CreateEntry "MM: Task Sequence Changed! Checking for variables @ Dynamic_" & sNew & "_Elements", LogTypeInfo |
|
|
|
1052 |
|
|
|
|
1053 |
'Don't feel like a function lets keep this in one spot with a single re-loop. Somewhat simpler overall. |
|
|
|
1054 |
aElement=Array("_Elements", "_Elements_LIST") |
|
|
|
1055 |
|
|
|
|
1056 |
For Each aItem In aElement |
|
|
|
1057 |
oLogging.CreateEntry "MM: Task Sequence Changed! Checking for variables @ Dynamic_" & sNew & aItem, LogTypeInfo |
|
|
|
1058 |
|
|
|
|
1059 |
'Get items (pointer) dictionary that lists any changed property name (i.e.Areacode,computerbackuplocation,applications,migfiles etc) |
|
|
|
1060 |
Set curDictionary = oEnvironment.ListItem("Dynamic_" & sNew & aItem) |
|
|
|
1061 |
|
|
|
|
1062 |
If curDictionary.Count > 0 Then |
|
|
|
1063 |
oLogging.CreateEntry "MM: Dynamic_" & sNew & aItem & " container is not empty, beginning update process.", LogTypeInfo |
|
|
|
1064 |
|
|
|
|
1065 |
curDictionaryKeys = curDictionary.Keys |
|
|
|
1066 |
|
|
|
|
1067 |
'Update original values with new task sequence values |
|
|
|
1068 |
For i = 0 to curDictionary.Count -1 |
|
|
|
1069 |
If aItem = "_Elements" Then |
|
|
|
1070 |
oLogging.CreateEntry "MM: Updating " & curDictionaryKeys(i) & ": " & oEnvironment.Item(curDictionaryKeys(i)) & " to " & oEnvironment.Item("Dynamic_" & sNew & "_" & curDictionaryKeys(i)), LogTypeInfo |
|
|
|
1071 |
oEnvironment.Item(curDictionaryKeys(i)) = oEnvironment.Item("Dynamic_" & sNew & "_" & curDictionaryKeys(i)) |
|
|
|
1072 |
ElseIf aItem = "_Elements_LIST" Then |
|
|
|
1073 |
oLogging.CreateEntry "MM: Updating List: " & curDictionaryKeys(i) & " to become list named: Dynamic_" & sNew & "_" & curDictionaryKeys(i), LogTypeInfo |
|
|
|
1074 |
Set curInnerDictionary = oEnvironment.ListItem("Dynamic_" & sNew & "_" & curDictionaryKeys(i)) |
|
|
|
1075 |
Set oEnvironment.ListItem(curDictionaryKeys(i)) = curInnerDictionary |
|
|
|
1076 |
Else |
|
|
|
1077 |
oLogging.CreateEntry "MM: ERROR, No list key defined for " & curDictionaryKeys(i) |
|
|
|
1078 |
End If |
|
|
|
1079 |
Next |
|
|
|
1080 |
End If |
|
|
|
1081 |
Next |
|
|
|
1082 |
End If |
|
|
|
1083 |
|
|
|
|
1084 |
'MM: Record current task sequence (used later to ensure that rules are not overwritten if gathering rules again at a later point) |
|
|
|
1085 |
oEnvironment.Item("MM_LastSequence") = sNew |
|
|
|
1086 |
oLogging.CreateEntry "MM: Current Sequence ID stored as: " & oEnvironment.Item("MM_LastSequence"), LogTypeInfo |
|
|
|
1087 |
End If |
|
|
|
1088 |
'MM: End Per-Task Settings Snippet |
|
|
|
1089 |
|
|
|
|
1090 |
|
|
|
|
1091 |
|
1036 |
End If |
= |
1092 |
End If |
1037 |
|
|
1093 |
|
1038 |
|
|
1094 |
|
1039 |
|
|
1095 |
|
1040 |
|
|
1096 |
|
1041 |
oEnv(sVariable) = sNew |
|
1097 |
oEnv(sVariable) = sNew |