Okay.
So we're going to start off this module by talking about scripts and specifically start up and log on,
shut down and log off scripts that are available within group policy.
And this is a really interesting module, I think, because it presents information about a feature
within group policy that frankly is very much of a legacy feature.
It's for sure the most popular or one of the most popular areas that I see in terms of group policy
implementations.
But it's also one of the most problematic.
So what we're going to try to do in this module is dive into some of those challenges and some of the
capabilities and sort of guide you through.
The best ways and the best places to use scripts policy.
So let's look at the capabilities first.
So GPIO based scripts have been a feature of group policy since it was introduced.
And of course there have been.
This concept of log on scripts as way far back isn't for 1935 you know Novell NetWare.
So log on.
Scripts are not a new concept by any stretch, and group policy sort of took it to the next level.
By allowing you to have multiple scripts running for a given computer or user.
And the scripts could be written in pretty much any language and can do pretty much anything you want.
Now, principally scripts and group policy are used to perform either startup or log on tasks.
I don't see as many shut down or log off scripts, but for example, with the log on script by and large
drive mappings or even printer mappings have been the most common usage for log on scripts in group
policy.
For start ups scripts lots of you know, per machine.
Machine specific file copies, registry tweaks, software installations really common in terms of what
I see for start up scripts.
And then, you know, shut down and log off.
Scripts are kind of in their own category.
I've seen them most often used for doing cleanup tasks.
Maybe deleting temporary files or, you know, saving off some portion of the user's profile during
log off or going those sorts of tasks where you want to sort of clean up after yourself after the user
has logged off or after the machine is in the process of shutting down.
Now group policy supports both pre-computer, startup and shutdown scripts and per user.
Log on and log off scripts.
And again, the scripts can be written in anything, any language that you can think of.
You can pretty much run a script in it.
That's everything from batch files to VB script to Daddy X Files to good old PowerShell.
Now there's as I've sort of alluded to at the beginning of this module, there's lots of limitations
in log on scripts and in startup scripts.
So some of those are just a function of the fact that GP preferences can do a lot of the tasks that
log on and startup scripts have been used for in the past.
Much better.
So they're easier to configure.
They're easier to manage.
They're easier to troubleshoot.
Scripts are kind of a black box.
You have to script.
You sort of have to be really smart about how you script, start up and log on scripts because of a
start up script or a log on script hangs.
The user is sitting there waiting for those scripts to finish before they get access to their system.
And the default hang time on a script in a GPO is 10 minutes.
So you've got the user sitting there for 10 minutes wondering what's going on, and that's never a good
situation.
And for some of these reason and just the fact that scripts run every time and do the same thing every
time, in a lot of situations, there are major cause of desktop slowdowns.
Microsoft comes out and does something called the desktop wrap or rapid assessment program.
And I think the most common result of that shows that start up or log on scripts end up causing a majority
of the slowdowns that you've experienced.
That's certainly what I've seen in a lot of environments.
Now scripts are good if you need what I call logic flexibility that scripting can provide that you can't
get from GP preferences using, for example, item level targeting or policies in terms of how they
deliver what their functionality is.
So let's look a little bit about what these scripts look like.
So shut down and startup scripts are found under computer configuration policies.
Windows Settings scripts.
And this screenshot just shows you the main dialogue that is available when you for both startup scripts
and frankly for log on scripts or log off.
You have this dialogue that lets you add scripts and the scripts can have parameters.
And you can add PowerShell scripts on a second tab, and I'll show you that in a little bit.
But essentially, you know, these two dialogues are really straightforward, really easy to use.
The only tricky part is in where you.
Where you put the script files.
You have a couple choices.
I will talk about that for sure.
But if you see the Show Files button on this, what happens when you press that is it opens up an Explorer
folder within the sizable portion of the GPO.
So it's the default location for scripts start up or shut down or log on and log off.
Is in the GPO storage.
The setting storage that's found inside small.
So, you know, you can put the files there or you can put them on a separate unsee pad somewhere else
on your network.
It doesn't really matter.
The point is that is the default location.
So let's dive in and kind of poke around in the scripts area for a little bit and see what we can find.