Wednesday, August 26, 2015

Can I access Internet Information Services in Windows 10 using Power Shell?

Using Power Shell Version 5.0 in Windows 10 you can access Internet Information Services on your computer(local site).

This shows the  build details for Windows 10 Version of IIS.


10IIS-00.PNG

In order to work with IIS using Power Shell, you must be,
  • the administrator
  • using Powershell version 5.0
Then you can run simple commands like this. Make the full use of Intellisense and color coding.



10IIS-01.PNG

You can launch Windows PowerShell ISE by searching for it as shown. Somehow typing into the search box does not appear to be fast, it takes breath after each letter and my computer is not old.





10IIS-03.PNG

You can do the same in just Windows PowerShell as well.

Here is the Application pool related cmdlet.
PS C:\WINDOWS\system32> Get-IISSite
Get-IISAppPool

Name             ID   State      Physical Path                  Bindings                                                                      
----             --   -----      -------------                  --------                                                                      
Default Web Site 1    Started    %SystemDrive%\inetpub\wwwroot  http *:80:                                                                    

AutoStart             : True
Cpu                   : Microsoft.Web.Administration.ApplicationPoolCpu
Enable32BitAppOnWin64 : False
Failure               : Microsoft.Web.Administration.ApplicationPoolFailure
ManagedPipelineMode   : Integrated
StartMode             : OnDemand
ManagedRuntimeVersion : v4.0
Name                  : DefaultAppPool
ProcessModel          : Microsoft.Web.Administration.ApplicationPoolProcessModel
QueueLength           : 1000
Recycling             : Microsoft.Web.Administration.ApplicationPoolRecycling
State                 : Started
WorkerProcesses       : {}
Attributes            : {name, queueLength, autoStart, enable32BitAppOnWin64...}
ChildElements         : {processModel, recycling, failure, cpu...}
ElementTagName        : add
IsLocallyStored       : True
Methods               : {Start, Stop, Recycle}
RawAttributes         : {[name, DefaultAppPool], [queueLength, 1000], [autoStart, True], [enable32BitAppOnWin64, False]...}
Schema                : Microsoft.Web.Administration.ConfigurationElementSchema


Of course the important thing is to get an handle on Server Manager and you do this:

PS C:\WINDOWS\system32> Get-IISServerManager


ApplicationDefaults      : Microsoft.Web.Administration.ApplicationDefaults
ApplicationPoolDefaults  : Microsoft.Web.Administration.ApplicationPoolDefaults
ApplicationPools         : {DefaultAppPool}
SiteDefaults             : Microsoft.Web.Administration.SiteDefaults
Sites                    : {Default Web Site}
VirtualDirectoryDefaults : Microsoft.Web.Administration.VirtualDirectoryDefaults
WorkerProcesses          : {}


Now you are cooking. You should also open the default site on your computer and review the objects.
 



 

No comments: