Question : Using COMAdmin to create a COM+ application running under an identity of "Network Service"

Hi,

I'm trying to create a COM+ application using the COMAdmin object.

I'm having problems with the identity property.  If I use a domain username and password it works fine.  However, some of our components run under the "Network Service" account.  Does anyone know how to specify this when creating the COM+ application?  I obviously don't have the password for this account,  and would like to know if it's possible to set the identity to "Network Service" (at all), and if it's possible to do without knowing the password.

Here's a code snippet.  

public void CreateCom(comApplication app)
{
    COMAdmin.COMAdminCatalogObject application;
    application = (COMAdmin.COMAdminCatalogObject)ObjApplications.Add();
    application.set_Value("Name",app.Name);
    application.set_Value("Description",app.Description);
    application.set_Value("Activation",app.Activation);
    application.set_Value("Identity","Network Service");//How do I specify the network service account?
    application.set_Value("Password", "");
    application.set_Value("ApplicationAccessChecksEnabled",app.ApplicationAccessChecks);
    objApplications.SaveChanges();
 
    foreach (comComponent com in app.DllFiles)
    {
        objAdmin.InstallComponent(application.Name.ToString(), com.ComDll, "", "");
    }
}

Incidentally, this is running on Windows XP SP2 at the moment, although it's intended for use on Server 2003.

These are values I have tried, without success:
 
application.set_Value("Identity","NT Authority\\Network service");
application.set_Value("Identity","NT Authority\\Networkservice");
application.set_Value("Identity","Network service");
application.set_Value("Identity","Networkservice");
application.set_Value("Identity",@"NT Authority\Network service");//Just in case
 
I have tried each of them with:
 
application.set_Value("Password", "");//blank password
application.set_Value("Password", "asdfasd");//a random, made-up password
//application.set_Value("Password", "");//No password property\value specified at all
 
Each of them results in an unhandled COMException

The identity or password set on the application is not valid (Exception from HRESULT: 0x80110414)

Thanks

Mick

Answer : Using COMAdmin to create a COM+ application running under an identity of "Network Service"

I do not htink there is a way to set "Network Account" using COMAdmin. Password for that account  is randomly generated by Windows. You will be better of if admin will create an account which mirrors rights of "Network Services" account, than you can easily set user ID and password.
Random Solutions  
 
programming4us programming4us