Overview.
Now I'm going to dig into preferences a little bit and kind of explore what I just talked about.
So here I am in a GPO and I've got the computer configuration preferences area.
Expanded and I'm going to go in under windows setting and just look at environment variables.
So I can go ahead and create a new preference for environment variables, and I can choose it to be
either user variable or system variable.
I can just come up with a variable name.
Let's just call it temp or actually let's do something a little bit more meaningful.
Let's just call it system.
And I'm not going to say that it's a path variable because it's its own variable.
And then I'm going to give it a value and I'm going to just say GPP.
Now again, notice the action option.
I can choose based on how I want this option to behave.
I can choose.
Update, create, replace.
Typically I will use update to set a new preference unless and specifically trying to accomplish a goal
like either deleting it or having it be replaced so that it doesn't tattoo the system.
So I'm going to go ahead and keep it at the update default.
Now let's go to the common tab and I'll show you how we can do basically item level targeting and some
of the other options that are available.
So let's go ahead and run through some of these options.
The start processing items in this extension.
If this error occurs, option is simply a way of telling it that you want all of these settings in this
particular extension to run or none of them to run.
The remove this item when it no longer applied actually changes the mode from update to replace.
So this is sort of telling it to behave like replace mode does.
And because you're doing that, then it's actually forcing it into replace mode.
So only check this option if you really want replace to be the action that you decide on.
Apply once and do not reapply.
This obviously has an impact on policy on actions like update or replace, which are designed to keep
reapplying if they need to.
This says only apply just once and never again for this particular computer or user.
So what you end up doing here is having it be kind of like a true preference where it sets it for the
user, but then the user can go in and change it subsequently.
Okay.
Now let's look at what item level targeting looks like.
So I'm going to go in here and click item level targeting and then bring up the item level targeting.
Ed And you'll see here that I have lots of options for different filters that I can use and let's just
pick a couple of them.
So battery present.
I want to say if the battery is present, then I want this policy or preference setting to apply so
that, you know, might be a good test for is it a laptop, for example?
Another one might be disk space.
So here you see if battery is present and free disk space is greater than or equal to 80 gig.
And I can change that value to be something other than 80 on the system drive letter or a specific drive
letter.
System drive letter being the drive letter that the operating system is installed on.
And you'll see here that it put in and in front of this condition.
So I could actually right click it and say item options and I could say or so I can change this from
an end to an or.
And I can say if a battery is present or disk space is greater than or free disk space is greater than
or equal to 80 gigabytes.
So I can easily change these options.
I can actually add nesting to the options.
So I can say add a collection.
And inside the collection I can add a targeting item.
So I can say an operating system is Windows eight or Windows eight professional.
So you'll see here that I've got a battery is present or free disk is greater than 80 gig and this collection
is true.
And what this means is all of the item level targeting in the collection evaluates to true.
So I've got an operating system test in there.
I could add a domain test.
Is the domain equal to my domain here?
So are two tests scuttled?
Is the computer account in the domain?
So what you've seen is I've created this kind of complex, conditional item level target where all of
these things have to evaluate to true in order for this preference setting to apply.
And again, remember, this is just on a single preference item that I defined right here.
So I can come in and add a second environment variable in here.
And, you know, I could call a test and give it a value and have its own set of item level targets
that are completely different from the other one.
And each of these would be evaluated in turn.
I could say, is this in the marketing or you, for example?
If the computer is in the marketing or you then apply this policy.
And now I've got these different preference items within a single GPO, each having its own set of item
level targets.
And I can reorder them.
So if this one, this test one needs to be evaluated first.
I can move it up in the order or I can also disable a particular setting.
So if I want to temporarily disable this particular environment variable, I can click here and you'll
notice here that it says disabled directly.
And that option, even though it's still in the GPO, even though the GPO is still active because it's
disabled, it's not going to process and I can go back and enable it if I want.
The other thing I can do is I can grab this preference item and I can drag it to my desktop.
And what does it do?
It creates a file on the desktop called Test XML.
And this is just a file containing the actual settings within this particular preference item.
You'll see here, it's an XML document that contains all the options that I specified for this environment
variable.
So let's say, for example, I was in a different GPO and I didn't have that test preference.
I just deleted it from this one.
So what I can do is then now that I've taken this item up here and put it on my desktop, I can right
click and copy it, come back into the group policy object and click paste.
And it will ask me if I want to confirm the paste.
And here we go.
We've just added that environment variable that had been deleted back into this GPO.
And I could also, you know, take this XML file and add it to a different GPO.
It's sort of a really quick and dirty way of getting settings out of group policy preferences and into
other GPOs.
And I can do this on more than one.
I can do it on two or more.
So it doesn't really matter how many I do it on.
I can follow this and or which preference area that I use.
I can follow this approach.
So lots of cool features within preferences.
You'll also remember that when I was in Internet Options, let me go down to Internet options under
control panel settings.
There was this notion of green, red and green underline and red underline.
And I talked about the F keys, F5, f6, F f7 and F eight, which let me modify the behavior of these
settings to tell it which of the settings I want to actually apply.
So there's a few tricks within group policy preferences that are handy to know.