原文出处: http://blog.csdn.net/kielin/article/details/5674714
Change IIS Application Pool Identity Type
@echo off
if "%1" == "" goto :ALert
if "%1" == "/?" goto :ALert
@set ProcessModelIndentyType=%~1
echo ProcessModelIndentyType=%ProcessModelIndentyType%
echo========================================================
echo Change the application pool process model identity type
echo========================================================
%windir%/system32/inetsrv/appcmd.exe set AppPool DefaultAppPool -processModel.identityType:%ProcessModelIndentyType%
%windir%/system32/inetsrv/appcmd.exe set AppPool "ASP.NET v4.0" -processModel.identityType:%ProcessModelIndentyType%
%windir%/system32/inetsrv/appcmd.exe set AppPool "ASP.NET v4.0 Classic" -processModel.identityType:%ProcessModelIndentyType%
%windir%/system32/inetsrv/appcmd.exe set AppPool "Classic .NET AppPool" -processModel.identityType:%ProcessModelIndentyType%
%windir%/system32/inetsrv/appcmd.exe set AppPool NexusIntegratedAppPool -processModel.identityType:%ProcessModelIndentyType%
%windir%/system32/inetsrv/appcmd.exe set AppPool NexusIsapiAppPool -processModel.identityType:%ProcessModelIndentyType%
Echo restart the IIS service
iisreset
goto :EOF
:ALert
Echo " Pleae input you AppPool name"
Echo " Format:"
Echo " %windir%/system32/inetsrv/appcmd.exe set AppPool <AppPoolName> -processModel.identityType:<ProcessModelIndentyType>"
Echo " ProcessModelIndentyType should be in follows:"
Echo ----ApplicationPoolIdentity
Echo ----NetworkService
Echo ----LocalService
Echo ----LocalSystem
goto :EOF
:EOF
stop