Home / Non classé / Powershell : Création de sites IIS8 sur Windows Server 2012

Powershell : Création de sites IIS8 sur Windows Server 2012

powershell

Je suis actuellement en pleine prise en main de powershell, je commence donc doucement, avec des petits script faciles à réaliser, ci-dessous, vous en trouverez un permettant de créer des sites sous IIS8 de façon rapide & facile. Ce script powershell crée l’Application Pool, le site, le repertoire et un fichier index.html :

Write-Host "Welcome in PSWebsiteCreator by Alexnogard from alexnogard.com" -ForegroundColor Red -BackgroundColor White
$SiteName = Read-Host "Please enter the site name"
$PhysPath = Read-Host "Please enter path pointing to your website (e.g. : c:\mywebsite)"
$BindingIP = Read-Host "Enter an Ip Address, or leave empty"
$BindingPort = Read-Host "Enter port you wanna use (e.g. : 81) "
$AppPool = Read-Host "You ApplicationPool Name (e.g. : Default Web Site)"
s
New-Item $PhysPath -type directory
New-Item $PhysPath\index.html -type file -force -value "<center>Coucou petite perruche</center>"
New-WebAppPool -Name $AppPool
New-Website -Name $SiteName -ApplicationPool FirstWebsiteAppPool -Force -PhysicalPath $PhysPath -Port $BindingPort

A bientôt ;)

About Alexandre Nogard

Check Also

Gophish : Familiarisez vos employés au phishing ! Part I : Installation

Gophish est un framework open-source, vous permettant de créer des campagnes de phishing. L’objectif, ici, …

Gophish : Familiarisez vos employés au phishing ! Part II : Prise en main

Nous avons vu dans le précédent post : Gophish : Familiarisez vos employés au phishing …

Gophish : Familiarisez vos employés au phishing ! Part III : Options avancées

Maintenant que GoPhish est installé et que vous avez lancé votre première campagne, vous souhaitez …

Leave a Reply

Your email address will not be published. Required fields are marked *