Skip to content

Commit 77c5d48

Browse files
author
somewhatsomewhere
authored
BUG FIX: preventing unnecessary retargetting loops
1 parent 66626c4 commit 77c5d48

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

ZeroDayPatch.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
using System.Data.SqlClient;
77
using System.Security;
88
using System.Security.Principal;
9-
109
using Altiris.NS;
1110
using Altiris.Resource;
1211
using Altiris.NS.ItemManagement;
@@ -164,7 +163,12 @@ private int RunAutomation(GuidCollection bulletins) {
164163
Console.WriteLine("\tSoftware update policy created!");
165164
} else if (config.Retarget) {
166165
if (policies_arr.Length > 0) {
167-
foreach (string p in policies_arr) {
166+
/* ENHANCEMENT: 2018-01-24; There is no need to update each policy - one of them will update the "parent" policy which is enough :D.
167+
* This avoid doing the same task 153 times when an Office policy as 153 updates!
168+
*
169+
* */
170+
// foreach (string p in policies_arr) {
171+
string p = policies_arr[0];
168172
if (p.Length != 36)
169173
continue;
170174

@@ -193,7 +197,7 @@ private int RunAutomation(GuidCollection bulletins) {
193197
Console.WriteLine("\tSaving the policy failed 10 times. Moving on to the next item.");
194198
}
195199
}
196-
}
200+
// } // Commented out for each node removed to fix
197201
}
198202
} else {
199203
Console.WriteLine("\tA policy already exists for this bulletin.");

0 commit comments

Comments
 (0)