1 00:00:03,060 --> 00:00:03,870 All right. 2 00:00:04,910 --> 00:00:08,570 So now I'm going to implement a log on script policy. 3 00:00:09,540 --> 00:00:15,480 So I've got my GPO created call log on script policy and I'm going to go ahead and edit it. 4 00:00:16,440 --> 00:00:22,680 And this time I'll go in under user configuration policies, window settings, scripts, log on. 5 00:00:22,680 --> 00:00:28,770 And remember I mentioned I wanted to demo using a PowerShell policy or a PowerShell script as my logged 6 00:00:28,770 --> 00:00:29,580 on scripture. 7 00:00:30,570 --> 00:00:35,250 So I'm going to go ahead and click on add browse to the location and see this fall. 8 00:00:36,220 --> 00:00:39,760 And I'm going to go ahead and create a PowerShell scripture. 9 00:00:40,800 --> 00:00:44,100 So I'm going to call it log on dot one. 10 00:00:44,990 --> 00:00:47,930 And yes, I want to change the extension. 11 00:00:48,840 --> 00:00:51,720 And I'm going to go ahead and right click and edit. 12 00:00:52,670 --> 00:00:55,250 And I'm going to go ahead and open the script. 13 00:00:56,200 --> 00:01:02,080 And it opens by default in the PowerShell ISC, which is the script editor that Microsoft provides for 14 00:01:02,080 --> 00:01:03,250 PowerShell scripts. 15 00:01:04,230 --> 00:01:09,990 I could have associated the one with Notepad, but in this case, I'll just go ahead and use this. 16 00:01:10,940 --> 00:01:17,510 And I'm going to go ahead and paste in a command that what this command does is it sets in a user environment 17 00:01:17,510 --> 00:01:18,230 variable. 18 00:01:19,210 --> 00:01:21,880 The variable is called user variable. 19 00:01:22,820 --> 00:01:25,310 And it sets it to the value of hello. 20 00:01:26,240 --> 00:01:31,940 So I'm essentially getting this script is going to execute a user variable change for the user when 21 00:01:31,940 --> 00:01:32,540 it runs. 22 00:01:33,570 --> 00:01:35,730 So I'm going to go ahead and save it. 23 00:01:36,710 --> 00:01:37,940 Close this out. 24 00:01:38,960 --> 00:01:41,270 So now I have my PowerShell script. 25 00:01:42,290 --> 00:01:45,410 I'm going to say open to selected into the GPO. 26 00:01:46,280 --> 00:01:48,020 And I could set this order. 27 00:01:49,060 --> 00:01:52,600 Since I don't have any other scripts here, I'm not going to bother. 28 00:01:53,570 --> 00:01:56,360 But I'll go ahead and leave it at not configured. 29 00:01:57,360 --> 00:01:58,530 Say, okay. 30 00:01:59,460 --> 00:02:05,610 And in this case, because this is a per user policy, I need to link it to where I have my user accounts. 31 00:02:06,600 --> 00:02:11,220 In this case, I've got my good old Joe sales in the sales users owe you. 32 00:02:12,120 --> 00:02:16,890 So I'm going to go ahead and drag this GPO up to the users o u and link it. 33 00:02:17,890 --> 00:02:20,440 Now let's go to my Windows seven client. 34 00:02:21,450 --> 00:02:26,310 And remember, I need to log off and log back on for this policy to take effect. 35 00:02:27,300 --> 00:02:29,460 So I'm going to go ahead and do that. 36 00:02:30,460 --> 00:02:32,140 Go ahead and log off. 37 00:02:33,130 --> 00:02:38,620 And now I'm logging back on and we can see now as it's applying user settings, we'll see if we can 38 00:02:38,620 --> 00:02:40,480 catch it at run scripts policy. 39 00:02:41,440 --> 00:02:44,050 It went by really quick, but it did run. 40 00:02:44,950 --> 00:02:49,510 And now what I'm going to do is go ahead and run the command prompt and type set. 41 00:02:50,450 --> 00:02:56,300 And remember, my variable was called user variable and it was set to Hello and there it is. 42 00:02:57,290 --> 00:02:59,630 I can highlight it here so you can see it. 43 00:03:00,620 --> 00:03:03,650 So user variable equals halo has been set. 44 00:03:04,620 --> 00:03:06,720 And the script has executed. 45 00:03:07,700 --> 00:03:12,650 So we've delivered a poor user setting to this user via log on script. 46 00:03:13,620 --> 00:03:19,350 And again, both of the things that I demoed in this module around startup scripts and log on scripts 47 00:03:19,350 --> 00:03:22,410 could both have been done using group policy preferences. 48 00:03:23,370 --> 00:03:29,220 Registry values can be modified using preferences or admin templates for that matter. 49 00:03:30,200 --> 00:03:34,130 Environment variables can be modified using preferences. 50 00:03:35,120 --> 00:03:40,940 But the point here is that Scripps does give you the capability if you need additional logic beyond 51 00:03:40,940 --> 00:03:42,770 what group policy can do for you. 52 00:03:43,660 --> 00:03:49,210 It does give you the capability to deliver these per computer and per user settings or changes.