1 00:00:03,070 --> 00:00:03,630 Okay. 2 00:00:03,640 --> 00:00:09,070 So we're going to start off this module by talking about scripts and specifically start up and log on, 3 00:00:09,160 --> 00:00:12,970 shut down and log off scripts that are available within group policy. 4 00:00:13,910 --> 00:00:18,800 And this is a really interesting module, I think, because it presents information about a feature 5 00:00:18,800 --> 00:00:22,610 within group policy that frankly is very much of a legacy feature. 6 00:00:23,600 --> 00:00:29,480 It's for sure the most popular or one of the most popular areas that I see in terms of group policy 7 00:00:29,480 --> 00:00:30,500 implementations. 8 00:00:31,460 --> 00:00:34,130 But it's also one of the most problematic. 9 00:00:35,110 --> 00:00:40,180 So what we're going to try to do in this module is dive into some of those challenges and some of the 10 00:00:40,180 --> 00:00:42,610 capabilities and sort of guide you through. 11 00:00:43,540 --> 00:00:47,140 The best ways and the best places to use scripts policy. 12 00:00:48,130 --> 00:00:50,680 So let's look at the capabilities first. 13 00:00:51,710 --> 00:00:56,420 So GPIO based scripts have been a feature of group policy since it was introduced. 14 00:00:56,420 --> 00:00:57,740 And of course there have been. 15 00:00:58,670 --> 00:01:05,210 This concept of log on scripts as way far back isn't for 1935 you know Novell NetWare. 16 00:01:06,210 --> 00:01:07,050 So log on. 17 00:01:07,050 --> 00:01:12,390 Scripts are not a new concept by any stretch, and group policy sort of took it to the next level. 18 00:01:13,350 --> 00:01:17,820 By allowing you to have multiple scripts running for a given computer or user. 19 00:01:18,000 --> 00:01:23,030 And the scripts could be written in pretty much any language and can do pretty much anything you want. 20 00:01:24,010 --> 00:01:29,560 Now, principally scripts and group policy are used to perform either startup or log on tasks. 21 00:01:30,600 --> 00:01:36,300 I don't see as many shut down or log off scripts, but for example, with the log on script by and large 22 00:01:36,300 --> 00:01:41,640 drive mappings or even printer mappings have been the most common usage for log on scripts in group 23 00:01:41,640 --> 00:01:42,300 policy. 24 00:01:43,260 --> 00:01:46,080 For start ups scripts lots of you know, per machine. 25 00:01:46,130 --> 00:01:52,470 Machine specific file copies, registry tweaks, software installations really common in terms of what 26 00:01:52,470 --> 00:01:53,970 I see for start up scripts. 27 00:01:54,910 --> 00:01:57,400 And then, you know, shut down and log off. 28 00:01:57,400 --> 00:01:59,650 Scripts are kind of in their own category. 29 00:02:00,610 --> 00:02:04,090 I've seen them most often used for doing cleanup tasks. 30 00:02:05,110 --> 00:02:10,690 Maybe deleting temporary files or, you know, saving off some portion of the user's profile during 31 00:02:10,690 --> 00:02:16,540 log off or going those sorts of tasks where you want to sort of clean up after yourself after the user 32 00:02:16,540 --> 00:02:20,230 has logged off or after the machine is in the process of shutting down. 33 00:02:21,170 --> 00:02:26,660 Now group policy supports both pre-computer, startup and shutdown scripts and per user. 34 00:02:26,660 --> 00:02:28,340 Log on and log off scripts. 35 00:02:29,290 --> 00:02:34,120 And again, the scripts can be written in anything, any language that you can think of. 36 00:02:34,300 --> 00:02:36,280 You can pretty much run a script in it. 37 00:02:37,250 --> 00:02:42,710 That's everything from batch files to VB script to Daddy X Files to good old PowerShell. 38 00:02:43,660 --> 00:02:49,090 Now there's as I've sort of alluded to at the beginning of this module, there's lots of limitations 39 00:02:49,090 --> 00:02:51,530 in log on scripts and in startup scripts. 40 00:02:51,550 --> 00:02:56,920 So some of those are just a function of the fact that GP preferences can do a lot of the tasks that 41 00:02:56,920 --> 00:02:59,820 log on and startup scripts have been used for in the past. 42 00:02:59,830 --> 00:03:00,520 Much better. 43 00:03:01,510 --> 00:03:03,580 So they're easier to configure. 44 00:03:04,590 --> 00:03:06,120 They're easier to manage. 45 00:03:07,110 --> 00:03:08,910 They're easier to troubleshoot. 46 00:03:09,940 --> 00:03:12,010 Scripts are kind of a black box. 47 00:03:13,010 --> 00:03:13,970 You have to script. 48 00:03:14,180 --> 00:03:19,040 You sort of have to be really smart about how you script, start up and log on scripts because of a 49 00:03:19,040 --> 00:03:21,470 start up script or a log on script hangs. 50 00:03:21,740 --> 00:03:26,510 The user is sitting there waiting for those scripts to finish before they get access to their system. 51 00:03:27,430 --> 00:03:31,810 And the default hang time on a script in a GPO is 10 minutes. 52 00:03:32,790 --> 00:03:38,040 So you've got the user sitting there for 10 minutes wondering what's going on, and that's never a good 53 00:03:38,040 --> 00:03:38,910 situation. 54 00:03:39,840 --> 00:03:44,850 And for some of these reason and just the fact that scripts run every time and do the same thing every 55 00:03:44,850 --> 00:03:49,320 time, in a lot of situations, there are major cause of desktop slowdowns. 56 00:03:50,320 --> 00:03:55,630 Microsoft comes out and does something called the desktop wrap or rapid assessment program. 57 00:03:55,630 --> 00:04:01,150 And I think the most common result of that shows that start up or log on scripts end up causing a majority 58 00:04:01,150 --> 00:04:03,250 of the slowdowns that you've experienced. 59 00:04:04,210 --> 00:04:07,420 That's certainly what I've seen in a lot of environments. 60 00:04:08,380 --> 00:04:14,290 Now scripts are good if you need what I call logic flexibility that scripting can provide that you can't 61 00:04:14,290 --> 00:04:20,140 get from GP preferences using, for example, item level targeting or policies in terms of how they 62 00:04:20,140 --> 00:04:22,180 deliver what their functionality is. 63 00:04:23,170 --> 00:04:26,710 So let's look a little bit about what these scripts look like. 64 00:04:27,700 --> 00:04:32,920 So shut down and startup scripts are found under computer configuration policies. 65 00:04:32,920 --> 00:04:34,270 Windows Settings scripts. 66 00:04:35,200 --> 00:04:40,720 And this screenshot just shows you the main dialogue that is available when you for both startup scripts 67 00:04:40,720 --> 00:04:43,430 and frankly for log on scripts or log off. 68 00:04:43,510 --> 00:04:47,830 You have this dialogue that lets you add scripts and the scripts can have parameters. 69 00:04:48,810 --> 00:04:53,730 And you can add PowerShell scripts on a second tab, and I'll show you that in a little bit. 70 00:04:54,680 --> 00:05:00,590 But essentially, you know, these two dialogues are really straightforward, really easy to use. 71 00:05:01,570 --> 00:05:04,180 The only tricky part is in where you. 72 00:05:05,110 --> 00:05:06,970 Where you put the script files. 73 00:05:07,940 --> 00:05:09,710 You have a couple choices. 74 00:05:10,700 --> 00:05:12,490 I will talk about that for sure. 75 00:05:12,500 --> 00:05:18,170 But if you see the Show Files button on this, what happens when you press that is it opens up an Explorer 76 00:05:18,170 --> 00:05:20,990 folder within the sizable portion of the GPO. 77 00:05:21,170 --> 00:05:26,180 So it's the default location for scripts start up or shut down or log on and log off. 78 00:05:27,150 --> 00:05:28,980 Is in the GPO storage. 79 00:05:29,040 --> 00:05:31,410 The setting storage that's found inside small. 80 00:05:32,400 --> 00:05:37,830 So, you know, you can put the files there or you can put them on a separate unsee pad somewhere else 81 00:05:37,830 --> 00:05:38,640 on your network. 82 00:05:38,850 --> 00:05:40,050 It doesn't really matter. 83 00:05:41,030 --> 00:05:44,030 The point is that is the default location. 84 00:05:45,010 --> 00:05:50,440 So let's dive in and kind of poke around in the scripts area for a little bit and see what we can find.