How to import group policy module in powershell

 

Even if you have the RSAT tools installed in your computer, the Group policy module is not working. If you type a command like get-gpo –all –domain MyDomain.com you will receive an error like this:
get-gpo : The term ‘get-gpo’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is
correct and try again.
To fix this problem, go to start menu and search for optionalfeatures, as shown below:
Then, you will see Windows features window appear.
Expand Remote Server Administration Tools – Feature Administration tools and select Group Policy Management Tools:
Wait for the installation
Once the installation is done, go to Power Shell and import the module. Using Import-Module grouppolicy command
PS C:\> Import-Module grouppolicy
PS C:\> 
Now we have all GPO commandlets available
If you want to see all commands that belong for this module, type Get-Command –module grouppolicyand hit enter

Enjoy It.

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s