-1

I am looking for a script which will set the value to "Enable/Not Configured/Disable" of Allow Remote Shell Access in Gpedit via Powershell script.

Below value state value should get changed to Disable via PS script I know I can use get-gpo to change the status but when I run "Import-Module GroupPolicy" I got below error.

Import-Module : The specified module 'GroupPolicy' was not loaded because no valid module file was found in any module directory. At line:1 char:1 + Import-Module GroupPolicy + ~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ResourceUnavailable: (GroupPolicy:String) [Import-Module], FileNotFoundException + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand 
2
  • Please clarify what you are asking. You wrote you could not open gpedit but prior to that you wrote steps that seem to imply you successfully opened gpedit. Your question says you are using PowerShell version 5.0 but you also tagged your question using different PowerShell versions. Please re-write your question. Commented Mar 9, 2018 at 18:20
  • @user5870571-- Changed the question Commented Mar 9, 2018 at 18:28

2 Answers 2

1

Your edits still don't clarify your question.

I'm going to try to answer what I understand your question to be. If my answer is not related to what you are trying to ask then please go back and clarify your question.

This looks like you may have installed RSAT but not enabled it in Control Panel. Please verify you have done each of the following:

  • Install RSAT
  • Restart your computer
  • Open Control Panel
  • Open Program and Features
  • Click "Turn Windows features on or off"
  • Enable RSAT
  • Open PowerShell
  • Run Import-Module GroupPolicy
0

You need to load the ActiveDirectory cmdlet set, like so:

import-module ActiveDirectory

If you don't have them, later versions of powershell come with NuGet which lets you install them without installing the entire RSAT toolkit:

install-module ActiveDirectory

You should now be able to run Get-GPO.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.