appcmd

Use Powershell to import website with Chinese domain

穿精又带淫゛_ 提交于 2020-12-06 17:05:18
问题 I’m trying use PowerShell to add website from xml file. When I just use CMD command appcmd add site /in < test.xml The binding of website is 「測試.com.tw」and everything be fine. But when I use Powershell Get-Content test.xml | appcmd add site /in The binding will be 「???.com.tw」 Even if I change chcp to 65001 or use “-encoding utf8” when get-content, but nothing change and still can’t correct import a website with Chinese domain. My server is 2008 R2 and Powershell 1.0 Does anyone know how I

Use Powershell to import website with Chinese domain

狂风中的少年 提交于 2020-12-06 17:03:36
问题 I’m trying use PowerShell to add website from xml file. When I just use CMD command appcmd add site /in < test.xml The binding of website is 「測試.com.tw」and everything be fine. But when I use Powershell Get-Content test.xml | appcmd add site /in The binding will be 「???.com.tw」 Even if I change chcp to 65001 or use “-encoding utf8” when get-content, but nothing change and still can’t correct import a website with Chinese domain. My server is 2008 R2 and Powershell 1.0 Does anyone know how I

Azure: How to execute a startup task delayed?

风格不统一 提交于 2020-01-04 05:59:20
问题 I have two Sites within my WebRole and have defined a Startup task. The first line works fine, it creates a new App pool for me: %WINDIR%\system32\inetsrv\appcmd.exe add apppool /name:"VCPool" /managedRuntimeVersion:"v4.0" /managedPipelineMode:"Integrated" Now I would like to change my second to this new created AppPool, but adding another line right after, doesn't help. %WINDIR%\system32\inetsrv\appcmd.exe set app "WebRole_IN_0_VC/" /applicationPool:"VCPool" It seems the second site is

Azure: How to execute a startup task delayed?

三世轮回 提交于 2020-01-04 05:59:11
问题 I have two Sites within my WebRole and have defined a Startup task. The first line works fine, it creates a new App pool for me: %WINDIR%\system32\inetsrv\appcmd.exe add apppool /name:"VCPool" /managedRuntimeVersion:"v4.0" /managedPipelineMode:"Integrated" Now I would like to change my second to this new created AppPool, but adding another line right after, doesn't help. %WINDIR%\system32\inetsrv\appcmd.exe set app "WebRole_IN_0_VC/" /applicationPool:"VCPool" It seems the second site is

How to set environment variables per site on IIS using appcmd.exe?

点点圈 提交于 2020-01-03 11:57:23
问题 It is very easy to set environment variables per site on IIS Manager: I looking for a way to do it using appcmd.exe so I can include this in my install script. The closest I got was this: C:\>C:\Windows\System32\inetsrv\appcmd.exe set config "dashboard" -section:system.webServer/aspNetCore /environmentVariables.[name='foo',value='bar'] /commit:apphost -> dashboard is my site's name. But this command returns this error: ERROR ( message:Cannot find requested collection element. ) 回答1: You may

UrlRewrite via appcmd

♀尐吖头ヾ 提交于 2020-01-03 05:28:08
问题 I want to create urlrewrite url using appcmd for redirecting all requests from http:// to https:// I tried to google but nothing found. Could you provide me some basic example? 回答1: Got it working with this: appcmd.exe set config -section:system.webServer/rewrite/rules /+"[name='http_redirect',enabled='True']" /commit:apphost appcmd.exe set config -section:system.webServer/rewrite/rules.[name='http_redirect'] /match.url:"(.*)" /match.ignoreCase:true /commit:apphost appcmd.exe set config

appcmd code in C#?

余生长醉 提交于 2019-12-25 12:27:07
问题 I have an web service that run's this: var Proc = new Process(); Proc.StartInfo.FileName = CredentialBatFile; Proc.StartInfo.Arguments = WebSiteName + " " + Apppool_Username + " " + Apppool_Password; Proc.Start(); The bat file has: C:\Windows\system32\inetsrv\appcmd.exe set site "%1" -virtualDirectoryDefaults.userName:%2 -virtualDirectoryDefaults.password:%3 If I run on localhost (on the server) it works fine. however if I run it on the server from the web service it fails. Can I achieve the

Setting UrlSegmentMaxLength from commadline

大城市里の小女人 提交于 2019-12-24 10:45:27
问题 Is there a way to set the UrlSegmentMaxLength value for Http.sys using appcmd/netsh or any other commandline utility? 回答1: I change this for my deployment in powershell Set-ItemProperty -Path HKLM:\System\CurrentControlSet\Services\HTTP\Parameters -Name UrlSegmentMaxLength -Value 500 Restart-Service W3SVC -Force 回答2: I realize this is an old question, but in case someone stumbles upon this, here's PowerShell one-liner that either creates the key and sets the value or updates existing value.

Running an OS command using apache-ant to IIS config

China☆狼群 提交于 2019-12-24 08:58:21
问题 I'm trying to create an ANT script which amongst other things will configure IIS. To do this, trying to harness the appcmd tool. However getting a strange error. The appcmd command runs fine outside of the ant script, but fails within. I'm using the exec task to kick it all off : <exec dir="C:\\Windows\\System32\\inetsrv\\" executable="C:\\Windows\\System32\\inetsrv\\appcmd.exe" output="d:\out.txt"> <arg value="appcmd set config /section:isapiCgiRestriction /+" [path='${appian_home}\\jakarta\

CFExecute not executing appcmd.exe

核能气质少年 提交于 2019-12-24 00:57:51
问题 I created the following code on a Cofdfusion server: file name: testWebsite.cfm <cfoutput> <cfset exec_command = "add site /name:""demosite"" /bindings:http://demosite.testserver.com:80 /physicalpath:""D:\Websites\demosite"" "> <cfexecute name="C:\Windows\System32\inetsrv\appcmd.exe" arguments="#exec_command#" timeout="60" /> Done! </cfoutput> But when I execute this file e.g. http://www.demoserver.com/testcases/testWebsite.cfm It just displays "Done!" without any errors, it doesn't execute