views:

40

answers:

1

I've read this article but it doesn't appear to use the ApplicationPool class described here. Feels like this is something simple I'm missing.

Also, in case anyone feels like being extra helpful, I'm trying to accomplish this in a PowerShell script that can basically take a list of application pool names and set their credentials using a script. I can obviously derive this from a straight C# implementation, however.

Thanks!

+1  A: 

You have to use the ProcessModel property:

using(ServerManager serverManager = new ServerManager()) {
ApplicationPool pool = serverManager.ApplicationPools["YourAppPool"];

pool.ProcessModel.IdentityType = ProcessModelIdentityType.SpecificUser;
pool.ProcessModel.UserName = @"TheUser";
pool.ProcessModel.Password = @"ThePassword";

serverManager.CommitChanges();
}

CarlosAg
Perfect, just what I was looking for. Thanks!
Brandon Linton