C
Christopher Aitchison
Hello,
I am attempting to write a web service that manages a DNS server using the
DNS WMI provider.
I have all the code I want working fine when it is called through a windows
application or console application, however as soon as I paste this code
into a webservice and try and execute it there I start getting a "generic
error". This is only happening when the webservice tries to manage a dns
service that is installed on the same machine, because you can not connect
to the local machine with the username and password options.
I believe I know why this is happening - but I am at a loss to finding a
work around.
The WMI objects use DCOM to connect to the remote/local computer, and even
though my webservice is impersonating a Domain Admin user because it is
using a MTA thread (like all web services do) it is reverting to the NT
AUTHORITY\NETWORK SERVICE account somewhere inside the System.Management
classes, which has no permissions. I don't want to give this account any
permissions either. I have tried to start a STA thread and have the work
done inside that thread but when I look at logs for the WMI it still says my
application is trying to connect using the network service account.
Does anyone know how I can force the WMI to use the currently impersonated
account?
Many thanks,
Chris Aitchison
I am attempting to write a web service that manages a DNS server using the
DNS WMI provider.
I have all the code I want working fine when it is called through a windows
application or console application, however as soon as I paste this code
into a webservice and try and execute it there I start getting a "generic
error". This is only happening when the webservice tries to manage a dns
service that is installed on the same machine, because you can not connect
to the local machine with the username and password options.
I believe I know why this is happening - but I am at a loss to finding a
work around.
The WMI objects use DCOM to connect to the remote/local computer, and even
though my webservice is impersonating a Domain Admin user because it is
using a MTA thread (like all web services do) it is reverting to the NT
AUTHORITY\NETWORK SERVICE account somewhere inside the System.Management
classes, which has no permissions. I don't want to give this account any
permissions either. I have tried to start a STA thread and have the work
done inside that thread but when I look at logs for the WMI it still says my
application is trying to connect using the network service account.
Does anyone know how I can force the WMI to use the currently impersonated
account?
Many thanks,
Chris Aitchison