Importing PowerShell Group Policy modules

Since I am using a fresh Windows 10 workstation with the RSAT tools installed, my Group Policy PowerShell cmdlets are all going to work without any special considerations. If you attempt to run the commands in this chapter and are receiving errors that your PowerShell doesn't seem to know what to do with those commands, then it sounds like you are running a version of PowerShell old enough that you need to manually import the Group Policy module before you can expect any results.

The command for importing that module is Import-Module GroupPolicy.

If you are unsure about whether or not you already have the Group Policy-specific PowerShell cmdlets available to use, there is a helpful command you can run that lists all of the commands available within the GroupPolicy Module:

Get-Command -module grouppolicy | select name

Running this command inside a PowerShell prompt will spit out a list of cmdlets that are available inside the Group Policy module, as seen in the following screenshot:

Many of these commands are the ones that we will be experimenting with throughout this chapter.

You may notice that I often interchange the words command and cmdlet (pronounced command-let). Technically, a cmdlet is more like a culmination of multiple commands that work together to do something, but for the most part it doesn't matter what lingo is used. Either way, we are talking about the thing you type into PowerShell to make something happen.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.188.180.254