1 00:00:06,120 --> 00:00:11,640 I want to finish up this module by talking about some options that you have for modifying the execution 2 00:00:11,640 --> 00:00:13,350 of group policy based scripts. 3 00:00:14,340 --> 00:00:20,340 So there are actually some settings within admin templates that allow you to configure script behavior. 4 00:00:21,350 --> 00:00:25,700 These are both per computer and per user, and they're not the same options in both. 5 00:00:25,700 --> 00:00:30,740 But some of them are similar that the user configuration options have fewer settings available. 6 00:00:31,750 --> 00:00:38,050 So under computer configuration, what you're seeing here and on the screen is a set of options to specify 7 00:00:38,050 --> 00:00:39,490 different script behavior. 8 00:00:40,470 --> 00:00:45,690 And I'm going to point out just three settings that probably are the most commonly used and the most 9 00:00:45,690 --> 00:00:46,230 useful. 10 00:00:47,210 --> 00:00:50,870 Just so you know what they do and how you might be able to use them. 11 00:00:51,830 --> 00:00:56,090 So the first one is specify maximum wait time for group policy scripts. 12 00:00:56,240 --> 00:01:01,760 And this is a way remember I mentioned that scripts by default take 10 minutes before they actually 13 00:01:01,760 --> 00:01:02,390 time out. 14 00:01:03,390 --> 00:01:09,210 So if a script is still running 10 minutes after it started, it's eventually it's going to basically 15 00:01:09,210 --> 00:01:10,020 go away. 16 00:01:10,950 --> 00:01:12,930 It will be killed by the system. 17 00:01:13,890 --> 00:01:19,350 What this policy lets you do is change the default ten minute time to something greater or less than 18 00:01:19,350 --> 00:01:20,100 10 minutes. 19 00:01:21,060 --> 00:01:25,860 And I've seen this used in a lot of situations to reduce that possible timeout. 20 00:01:26,870 --> 00:01:31,730 So if you do get a script that hangs for some reason and you're not handling it in your script code, 21 00:01:31,820 --> 00:01:37,370 you can at the very least you can see that the script will kill itself in a shorter period of time. 22 00:01:38,300 --> 00:01:44,060 You know, in most cases, if a script is taking even as much as a minute to run, you're probably doing 23 00:01:44,090 --> 00:01:49,640 too much in that script because this is obviously impacting the user's ability to get their job done, 24 00:01:49,760 --> 00:01:51,500 get the machine available to them. 25 00:01:52,400 --> 00:01:58,580 So I highly recommend modifying this down to some value that you think is reasonable for your script 26 00:01:58,580 --> 00:01:59,300 environment. 27 00:02:00,270 --> 00:02:05,640 The other policy that I think is useful to use is the run log on script synchronously. 28 00:02:06,600 --> 00:02:10,080 This is so let me just describe how scripts run normally. 29 00:02:11,040 --> 00:02:16,650 If you have multiple scripts running in your environment, they will run asynchronously, which means 30 00:02:16,650 --> 00:02:19,920 that they're not going to necessarily run one after the other. 31 00:02:20,920 --> 00:02:22,870 They're going to run at the same time. 32 00:02:22,900 --> 00:02:24,700 If you have multiple scripts. 33 00:02:25,670 --> 00:02:30,670 They're going to kick off one after the other without waiting for the first one to finish. 34 00:02:31,640 --> 00:02:36,590 If for some reason you need scripts to wait for the first one to finish, then you can set this run, 35 00:02:36,590 --> 00:02:41,330 log on script synchronously for those log on scripts and also start up scripts. 36 00:02:42,300 --> 00:02:44,190 There's an option for that below. 37 00:02:45,090 --> 00:02:50,850 You can set those to run synchronously or in the case of startup scripts asynchronously. 38 00:02:51,830 --> 00:02:54,920 So start up scripts are a little bit different. 39 00:02:55,960 --> 00:03:01,810 Startup scripts run synchronously by default, and you can set them to run asynchronously. 40 00:03:02,770 --> 00:03:04,540 So a little different behavior. 41 00:03:04,690 --> 00:03:07,210 Two different policies for controlling them. 42 00:03:08,180 --> 00:03:12,890 So if you want log on scripts to run synchronously, you enable that policy. 43 00:03:13,870 --> 00:03:18,490 If you want startup scripts to run asynchronously, you enable that policy. 44 00:03:19,420 --> 00:03:25,300 And these are just a couple of different options for controlling the order of script processing or controlling 45 00:03:25,300 --> 00:03:27,250 the behavior of script processing. 46 00:03:28,180 --> 00:03:31,960 You'll notice there are scripts around PowerShell execution order. 47 00:03:32,930 --> 00:03:38,660 Instead of setting it in the GPO, you can set it at the group policy level and it will essentially 48 00:03:38,660 --> 00:03:40,820 set it for all scripts in that order. 49 00:03:41,800 --> 00:03:46,750 And this is just a little bit of control that you have over script execution that you might want to 50 00:03:46,750 --> 00:03:47,650 consider using. 51 00:03:47,650 --> 00:03:52,150 If, for example, in the timeout case here, your timeouts are too long. 52 00:03:53,110 --> 00:03:56,260 So now let's summarize what we learned in this module. 53 00:03:57,210 --> 00:04:02,670 And in the next module, we're going to talk a little bit about a special kind of configuration called 54 00:04:02,670 --> 00:04:04,050 Loopback Processing.