So let's run through some of these command letters that I just used in the past slides.
So let's go ahead and create a new GPO.
And again, I'm going to use the new GPO Command, let with a name of test policy.
And what you see is it returns information about the GPO as it's being created.
So it got the name.
It's got the domain name.
The owner ad version, of course, is zero.
If I come back into PMC, go up and refresh my group policy objects container, you'll see that.
Sure enough, it's created that GPO.
Now, what I want to do is rename this GPO using the renamed GPO Command Lit.
So let's go ahead and paste that command in.
So we'll do renamed GPO Name Test Policy.
And I'm going to give it a new target name of marketing lockdown policy.
And there we go.
I've just renamed it.
So if I again come back into AMC, if I hit a five, you'll notice that it just got switched to marketing
lockdown.
And after all that, I can go ahead and say, remove GPO Marketing Lockdown, give it the name parameter
just to keep everything clear.
Marketing.
Lockdown Policy.
And it deletes the GPO.
No fuss, no muss.
Again, come up to AMC, hit refresh, and it's gone.
Now, remember I said that you could easily get a count of all GPOs using the GPIO command, let with
the wall parameter and passing it as an expression to the count property.
And there I got I've got 28 GPOs in this domain.
So all good.
So now what I want to do is I want to get some information about some existing GPOs.
I've got this locked down policy, locked down GPO, and I'm going to go ahead and get the permissions
on this.
So I'm going to go ahead and get the permissions on the GPO.
So get GP permission of the name lock down policy.
And I'm going to say I want all permissions on the GPO.
So now what it did is it returned four objects for each different permission.
Here's authenticated users with the GPO apply permission.
That's basically that security filter that lets that authenticated users group groups process this policy.
Now, what I want to do is go ahead and set the permissions.
Now I'm going to go ahead and clear the screen here so that I can get a fresh canvas.
Now, what I want to do is set permissions on that lock down policy.
So I'm going to go ahead and copy that command in.
And what I'm going to do is set permissions on the lock down policy.
Permission level is going to be oops.
Let me get back to my parameter here and I'll show you the possible permissions.
So I can have possibly GPO custom.
I'm going to use GPO.
Edit Target name is the sales admin.
So you are group and the target type is group.
So now if I do a get permission on the lockdown policy, get GP permission on name lockdown policy.
Use the all parameter.
And now I've got that sales admins group that's been added.
So now let's go ahead and clear the screen again and let's go ahead and do a linking of our lockdown
policy to an you.
So we've got our users marketing our you and I specified the lock down GPO with the new link command
lit and I want to tell it that the link enabled is yes and the order is number one.
So let's go ahead and issue that command and it comes back and tells me that it did it.
And if I come into the marketing users.
Oh, you up here?
And hit refresh.
You'll see.
I've got my lockdown policy all linked up there.
Now, if I wanted to, for example, change that link to be enforced, I can come back into PowerShell
and paste in the said link GP link command lit again with the target of the EU and enforce set to.
You can't see it here but it's set to.
Yes and if I hit enter and come back to EMC and hit refresh, you'll note the little lock symbol that
just showed up there.
So I've been able to do that refresh.
Now let's look at backing up GPOs.
Again.
We've got lots of capabilities within PowerShell to do this.
The backup GPIO command, let give it the GPO name.
Give it the path to the to the backup folder.
And a comment in this case, lock down PowerShell lock down policy.
PowerShell backup.
And it takes a little bit to run, but then it comes back, tells me that it's made the backup.
Now this is the backup ID that was created.
And if I go into my backup folder, let me just go back up here to my GPO backups folder.
You'll see that the 76 B corresponds to the folder name and that's the the actual backup ID.
So when it comes time to do a restore or an import and I have defeated the backup ID, you'll see if
I paste in my restore command that I've got a backup ID, this is actually a different backup.
But if I come up here, I can get the backup ID that I just created and go ahead and put it into this
command.
So let me go ahead and clear out that one and paste in that new backup I.D. And I can do the restore
and it restores me back to the GPIO settings that were in there from this backup.
So again, I'm using the backup ID as the thing that I'm keying on for the restore.
And this is, you know, just a sampling of the things that you can do, a pretty broad sampling of
the things you can do in the PowerShell group policy module.
Next, I want to look at the capabilities of some VBScript sample scripts that are available from Microsoft.