Quantcast
Channel: Security
Viewing all articles
Browse latest Browse all 1881

Execute Appcmd Remotely

$
0
0

Hi,

I have to change the anonymous authentication password on may sites on dozens of servers, while psexec with appcmd

works fine on IIS6 (Windows 2003) on IIS7.5 (Windows 2008 R2) this doesnot work. Is there something missing in the below

batch or could I do it with powershell ?

***********************************************************************************************************************************************

@echo off
if exist change-IIS-password.log del change-IIS-password.log
echo --------Start !-------------- >> change-IIS-password.log
for /f "tokens=1" %%i in (servers.txt) do (
echo connect server %%i >> change-IIS-password.log
psexec -s \\%%i -u domain\user -p password C:\Windows\System32\inetsrv\appcmd set config "Default Web Site/site1" -section:anonymousAuthentication /userName:"domain\service_account" /password:"password" >> change-IIS-password.log

echo --------Done !-------------- >> change-IIS-password.log

*********************************************************************************************************************


Viewing all articles
Browse latest Browse all 1881

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>