Archive for January, 2013

To begin IIS administration from Powershell, use the following command,

PS <path>Import-Module WebAdministration

If you find any error, proceed with below Set-ExecutionPolicy command

By default the “Execution Policy” powershell is “Restricted“. So that means if you just run the import command or WebAdministration, you will get an Exception from powershell. We can set the this policy to “RemoteSigned” that will allow your custom scripts to be run but will not allow any internet downloaded script which is not trusted.

PS <Local_Path> Set-ExecutionPolicy RemoteSigned

and proceed with Yes

and now try PS <path>Import-Module WebAdministration

and now you are succeed ! ! 🙂

To advance, try listing possible IIS PowerShell commands,

PS <path>get-command

PS <path>get-command -pssnapin WebAdministration

Read Full Post »