简体   繁体   中英

IIS 7.5 Powershell script - Management service & Configure Web Deploy Publishing

I am creating a script to automate an IIS install on server 2012,

having the script near completed I can't find any information on the following two topics: - Management Service - Configure Web Deploy Publishing

Specifically within management service I am looking to set an IP automatically using a pre-set parameter within my script ,is this possible? Any forums/articles I have read have yet to mention this area within powershell

Secondly within Configure Web Deploy Publishing, I am looking to change the default username, again using a pre-set parameter within my script.

If anyone could point me in the right direction it would be perfect.

Thanks!

About the IIS Management Service, I looked at my own server setup scripts which are a few years old and not exclusively PowerShell:

It seems there are two registry locations you need to change, here's part of my script:

sc.exe config wmsvc start= delayed-auto
reg.exe add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WebManagement\Server /v EnableRemoteManagement /t REG_DWORD /d 1 /f
net start wmsvc

In the same registry key there is a Reg_SZ IPAddress which you can set.

There is also: HKLM:\\SYSTEM\\CurrentControlSet\\services\\http\\parameters\\SslBindingInfo\\0.0.0.0:8172

you need to have a new key with your own IP, rather than doing this manually, you should use netsh instead:

$thumb = (ls cert:\LocalMachine\MY | where-object { $_.FriendlyName -like "*WMSvc*" } | Select-Object -First 1).Thumbprint
$guid = [guid]::NewGuid()

& netsh http delete sslcert ipport=0.0.0.0:8172
& netsh http add sslcert ipport=192.168.10.10:8172 certhash=$thumb appid=`{$guid`}

I haven't tested this because I never had to change the default 0.0.0.0, but I expect this should work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM