Installing Network Policy Server from PowerShell

Recently I encountered a strange error where I couldn’t install Network Policy Server from the Server Manager.

Rather than fight with Server Manager, I punted and installed it via PowerShell. The installation that way worked without an problem.

Run PowerShell as Administrator

Run:

Import-Module Servermanager

Updated 2023:

The name of the feature has changed from “npas-policy-server” to just “npas”. For newer versions of Windows Server, run:

install-windowsfeature -name npas -IncludeManagementTools

Older (probably unsupported) versions of Window Server would use:

install-windowsfeature -name npas-policy-server -IncludeManagementTools

That’s it!

2 thoughts on “Installing Network Policy Server from PowerShell”

  1. install-windowsfeature : ArgumentNotValid: The role, role service, or feature name is not valid: ‘npas-policy-server’.
    The name was not found.
    At line:1 char:1
    + install-windowsfeature -name npas-policy-server -IncludeManagementToo …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidArgument: (npas-policy-server:String) [Install-WindowsFeature], Exception
    + FullyQualifiedErrorId : NameDoesNotExist,Microsoft.Windows.ServerManager.Commands.AddWindowsFeatureCommand

    1. Hi, thanks for reaching out!
      In later version of Windows Server the name was changed to just “NPAS”
      You should be able to install with the command:
      install-windowsfeature -name npas -IncludeManagementTools

      I’ve updated the article above.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.