Top Banner
25

Microsoft TechDays Дмитрий Сотников MVP Quest Software.

Dec 20, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Microsoft TechDays Дмитрий Сотников MVP Quest Software.
Page 2: Microsoft TechDays Дмитрий Сотников MVP Quest Software.

Microsoft TechDayshttp://www.techdays.ru

Управление IIS с помощью PowerShell

Дмитрий СотниковMVPQuest Software

Page 3: Microsoft TechDays Дмитрий Сотников MVP Quest Software.

Microsoft TechDayshttp://www.techdays.ru

IIS и PowerShell

Где взятьЧто в нем естьДемонстрация

Page 4: Microsoft TechDays Дмитрий Сотников MVP Quest Software.

Microsoft TechDayshttp://www.techdays.ru

Установка

PowerShellВерсия 1.0 входит в Windows Server 2008Server Manager / Features / Add Features / Windows PowerShell

IIS ProviderТребует самостоятельной загрузки с www.iis.net

Page 5: Microsoft TechDays Дмитрий Сотников MVP Quest Software.

Microsoft TechDayshttp://www.techdays.ru

Что внутри

ПровайдерПредставляет веб-сервер как дополнительный диск

Кмдлеты72 команды

Page 6: Microsoft TechDays Дмитрий Сотников MVP Quest Software.

Microsoft TechDayshttp://www.techdays.ru

WebConfiguration

Add-WebConfigurationClear-WebConfigurationGet-WebConfigurationSelect-WebConfigurationSet-WebConfiguration

Add-WebConfiguration //defaultDocument/files "IIS:\sites\Default Web Site" -at 0 -value @{value="new-index.html"}

Page 7: Microsoft TechDays Дмитрий Сотников MVP Quest Software.

Microsoft TechDayshttp://www.techdays.ru

WebConfigurationBackup

Backup-WebConfigurationGet-WebConfigurationBackupRemove-WebConfigurationBackupRestore-WebConfiguration

Backup-WebConfiguration MyBackupRestore-WebConfiguration -Name MyBackup

Page 8: Microsoft TechDays Дмитрий Сотников MVP Quest Software.

Microsoft TechDayshttp://www.techdays.ru

WebGlobalModule

Disable-WebGlobalModuleEnable-WebGlobalModuleGet-WebGlobalModuleNew-WebGlobalModuleRemove-WebGlobalModuleSet-WebGlobalModule

Disable-WebGlobalModule -name FastCgiModule -pspath 'iis:\sites\mysite'

Page 9: Microsoft TechDays Дмитрий Сотников MVP Quest Software.

Microsoft TechDayshttp://www.techdays.ru

WebAppPool

New-WebAppPoolRemove-WebAppPoolRestart-WebAppPoolStart-WebAppPoolStop-WebAppPoolGet-WebAppPoolState

New-WebAppPool MyNewAppPoolGet-WebAppPoolState MyNewAppPool

Page 10: Microsoft TechDays Дмитрий Сотников MVP Quest Software.

Microsoft TechDayshttp://www.techdays.ru

Website

Get-WebsiteNew-WebsiteNew-WebFtpSiteRemove-WebsiteStart-WebsiteStop-Website

Get-WebsiteState

New-WebFtpSite -name testFtpSite-Port 21-PhysicalPath c:\test-HostHeader mySite-IPAddress 127.0.0.1

Page 11: Microsoft TechDays Дмитрий Сотников MVP Quest Software.

Microsoft TechDayshttp://www.techdays.ru

WebHandler

Get-WebHandlerNew-WebHandlerRemove-WebHandlerSet-WebHandler

Set-WebHandler -name StaticFile –Path "*.htm"

Page 12: Microsoft TechDays Дмитрий Сотников MVP Quest Software.

Microsoft TechDayshttp://www.techdays.ru

WebManagedModule

Get-WebManagedModuleNew-WebManagedModuleRemove-WebManagedModuleSet-WebManagedModule

Set-WebManagedModule -Name UrlMappingsModule -Type Test.Test

Page 13: Microsoft TechDays Дмитрий Сотников MVP Quest Software.

Microsoft TechDayshttp://www.techdays.ru

WebBinding

Get-WebBindingNew-WebBindingRemove-WebBindingSet-WebBinding

Set-WebBinding -name 'Default Web Site'

-BindingInformation "*:80:" -PropertyName Port -Value 1234

Page 14: Microsoft TechDays Дмитрий Сотников MVP Quest Software.

Microsoft TechDayshttp://www.techdays.ru

WebConfigurationProperty

Add-WebConfigurationPropertyGet-WebConfigurationPropertyRemove-WebConfigurationPropertySet-WebConfigurationProperty

Set-WebConfigurationProperty "//handlers/add[@path='*.aspx']" -PSPath IIS:\ -name path –value “*.mspx”

Page 15: Microsoft TechDays Дмитрий Сотников MVP Quest Software.

Microsoft TechDayshttp://www.techdays.ru

WebApplication

ConvertTo-WebApplicationGet-WebApplicationNew-WebApplicationRemove-WebApplication

New-WebApplication -name testApp -site 'Default Web Site' -PhysicalPath c:\test

-ApplicationPool DefaultAppPool

Page 16: Microsoft TechDays Дмитрий Сотников MVP Quest Software.

Microsoft TechDayshttp://www.techdays.ru

WebConfigurationLocation

Get-WebConfigurationLocationRemove-WebConfigurationLocationRename-WebConfigurationLocation

Remove-WebConfigurationLocation -Name "SuperSite/my*"

Get-WebConfigurationLocation -Name "SuperSite" -psPath "IIS:\"

Page 17: Microsoft TechDays Дмитрий Сотников MVP Quest Software.

Microsoft TechDayshttp://www.techdays.ru

WebItem

Restart-WebItemStart-WebItemStop-WebItemGet-WebItemState

Restart-WebItem 'IIS:\AppPools\DefaultAppPool'

Page 18: Microsoft TechDays Дмитрий Сотников MVP Quest Software.

Microsoft TechDayshttp://www.techdays.ru

WebVirtualDirectory

Get-WebVirtualDirectoryNew-WebVirtualDirectoryRemove-WebVirtualDirectory

Get-WebVirtualDirectory -site 'Default Web Site' -Application testApp

Page 19: Microsoft TechDays Дмитрий Сотников MVP Quest Software.

Microsoft TechDayshttp://www.techdays.ru

WebConfigurationLock

Add-WebConfigurationLockGet-WebConfigurationLockRemove-WebConfigurationLock

Add-WebConfigurationLock -type inclusive -Filter //asp/@lcid

Page 20: Microsoft TechDays Дмитрий Сотников MVP Quest Software.

Microsoft TechDayshttp://www.techdays.ru

WebCommitDelay

Begin-WebCommitDelayEnd-WebCommitDelay

Begin-WebCommitDelay...End-WebCommitDelay

Page 21: Microsoft TechDays Дмитрий Сотников MVP Quest Software.

Microsoft TechDayshttp://www.techdays.ru

WebRequestTracing

Disable-WebRequestTracingEnable-WebRequestTracingClear-WebRequestTracingSettings

Enable-WebRequestTracing -Name "Default Web Site"

Page 22: Microsoft TechDays Дмитрий Сотников MVP Quest Software.

Microsoft TechDayshttp://www.techdays.ru

Разное

Get-WebConfigFileGet-WebURLGet-WebFilePathGet-WebAppDomainGet-WebRequestGet-UserPrivileges

Get-UserPrivileges NetworkService

Page 23: Microsoft TechDays Дмитрий Сотников MVP Quest Software.

Microsoft TechDayshttp://www.techdays.ru

Ссылки по темеСтраничка ресурсов IIS 7:

http://www.iis.netДокументация по PowerShell IIS Provider

Мои блоги:http://dmitrysotnikov.wordpress.comhttp://www.itcommunity.ru/blogs/dmitrysotnikov

Другие русские блоги по PowerShell:http://xaegr.wordpress.com/http://www.sysadmins.lv/ http://blogs.technet.com/abeshkov/

Инструментарий:http://powergui.org

Page 24: Microsoft TechDays Дмитрий Сотников MVP Quest Software.

Microsoft TechDayshttp://www.techdays.ru

© 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.

The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after

the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Page 25: Microsoft TechDays Дмитрий Сотников MVP Quest Software.