문제

I'm writing a PowerShell script to set a UserName and Password on Identity settings in Application Pool on IIS 6 (Windows Server 2003 R2). For that purposes i'm using vbscript from here. But after running a script i still have to manually switch "Identity" from "Predefined" to "Configurable". Is there a way to select "Configurable" via powershell script?

enter image description here

도움이 되었습니까?

해결책

Found solution. The following PowerShell code solves the issue.

#Assigning Identity's Username To AppPool    
cscript adsutil.vbs SET w3svc/AppPools/YourAppPoolName/WAMUserName Username

#Assigning Identity's Password To AppPool
cscript adsutil.vbs SET w3svc/AppPools/YourAppPoolName/WAMUserPass Password

#Making ApplicationPool Configurable
cscript adsutil.vbs SET w3svc/AppPools/YourAppPoolName/AppPoolIdentityType 3
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top