All right.
So now I'm going to implement a log on script policy.
So I've got my GPO created call log on script policy and I'm going to go ahead and edit it.
And this time I'll go in under user configuration policies, window settings, scripts, log on.
And remember I mentioned I wanted to demo using a PowerShell policy or a PowerShell script as my logged
on scripture.
So I'm going to go ahead and click on add browse to the location and see this fall.
And I'm going to go ahead and create a PowerShell scripture.
So I'm going to call it log on dot one.
And yes, I want to change the extension.
And I'm going to go ahead and right click and edit.
And I'm going to go ahead and open the script.
And it opens by default in the PowerShell ISC, which is the script editor that Microsoft provides for
PowerShell scripts.
I could have associated the one with Notepad, but in this case, I'll just go ahead and use this.
And I'm going to go ahead and paste in a command that what this command does is it sets in a user environment
variable.
The variable is called user variable.
And it sets it to the value of hello.
So I'm essentially getting this script is going to execute a user variable change for the user when
it runs.
So I'm going to go ahead and save it.
Close this out.
So now I have my PowerShell script.
I'm going to say open to selected into the GPO.
And I could set this order.
Since I don't have any other scripts here, I'm not going to bother.
But I'll go ahead and leave it at not configured.
Say, okay.
And in this case, because this is a per user policy, I need to link it to where I have my user accounts.
In this case, I've got my good old Joe sales in the sales users owe you.
So I'm going to go ahead and drag this GPO up to the users o u and link it.
Now let's go to my Windows seven client.
And remember, I need to log off and log back on for this policy to take effect.
So I'm going to go ahead and do that.
Go ahead and log off.
And now I'm logging back on and we can see now as it's applying user settings, we'll see if we can
catch it at run scripts policy.
It went by really quick, but it did run.
And now what I'm going to do is go ahead and run the command prompt and type set.
And remember, my variable was called user variable and it was set to Hello and there it is.
I can highlight it here so you can see it.
So user variable equals halo has been set.
And the script has executed.
So we've delivered a poor user setting to this user via log on script.
And again, both of the things that I demoed in this module around startup scripts and log on scripts
could both have been done using group policy preferences.
Registry values can be modified using preferences or admin templates for that matter.
Environment variables can be modified using preferences.
But the point here is that Scripps does give you the capability if you need additional logic beyond
what group policy can do for you.
It does give you the capability to deliver these per computer and per user settings or changes.