-1

I apologize if this is a NOOB question but I wrote a PowerShell script on my windows 10 box and I am trying to run the script on a 2008 box. On the new install of the 2008 box I had to add the windows powershell feature. My end goal is to install the Web Server (IIS) Administration Cmdlets

PS C:\Users\Administrator> Get-Module -ListAvailable | Import-Module
PS C:\Users\Administrator> Get-Module -ListAvailable

ModuleType Name                      ExportedCommands
---------- ----                      ----------------
Manifest   BitsTransfer              {}
Manifest   PSDiagnostics             {Enable-PSTrace, Enable-WSManTrace,  Start-Trace, Disable-PSWSManCombined...


PS C:\Users\Administrator>
PS C:\Users\Administrator> add-pssnapin WebAdministration
Add-PSSnapin : No snap-ins have been registered for Windows PowerShell version 2.
At line:1 char:13
+ add-pssnapin <<<<  WebAdministration
+ CategoryInfo          : InvalidArgument: (WebAdministration:String) [Add-PSSnapin], PSArgumentException
+ FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand

PS C:\Users\Administrator>
PS C:\Users\Administrator> Import-Module WebAdministration
Import-Module : The specified module 'WebAdministration' was not loaded because no valid module file was found in any module directory.
At line:1 char:14
+ Import-Module <<<<  WebAdministration
+ CategoryInfo          : ResourceUnavailable: (WebAdministration:String) [Import-Module], FileNotFoundException
+ FullyQualifiedErrorId :Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

Any ideas?

bdawg
  • 343
  • 3
  • 13

2 Answers2

3

You need to install the IIS managment tools before the WebAdministration-module is available. Try (tested on Win10):

Enable-WindowsOptionalFeature -Online -FeatureName "IIS-WebServerManagementTools" -All
Frode F.
  • 52,376
  • 9
  • 98
  • 114
3

Windows Server 2008 doesn't come with a PowerShell module for managing IIS. That feature was added with Windows Server 2008 R2. You need to download and install it first. See here for further information. See also this related question.

Community
  • 1
  • 1
Ansgar Wiechers
  • 193,178
  • 25
  • 254
  • 328