S
screenbert
I have a need to create a web-portal that allows certain users to
create DNS A records in a specific domain.
I've looked into using WMI to do this in my C# code, but the DNS server
is on a Domain Controller. In order to use WMI, we would have to allow
the service account to have more permissions than we want to give the
service account, since the target server is a Domain Controller.
I've also looked into using DNSCMD.exe and launching a Shell, but in
order to do this the username and password has to be in our code
unencrypted. Once again a security risk.
The only option I see left is using the DNSAPI from within C#. However
this is where I'm a little lost. I've seen examples on the net where
people have used the DNS_Query function, but no examples of anyone
using the DnsModifyRecordsInSet function. (
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dns/dns/dnsmodifyrecordsinset.asp
)
I know that I have to declare the API in my C# code, and then also the
various types have to be specified. This is where I'm lost. C# doesn't
recognize HANDLE hContext.
Does anyone have any code examples on how to use the
DNSModifyRecordsInSet function from within C#? Any assistance would be
greatly appreciated.
Screenbert
create DNS A records in a specific domain.
I've looked into using WMI to do this in my C# code, but the DNS server
is on a Domain Controller. In order to use WMI, we would have to allow
the service account to have more permissions than we want to give the
service account, since the target server is a Domain Controller.
I've also looked into using DNSCMD.exe and launching a Shell, but in
order to do this the username and password has to be in our code
unencrypted. Once again a security risk.
The only option I see left is using the DNSAPI from within C#. However
this is where I'm a little lost. I've seen examples on the net where
people have used the DNS_Query function, but no examples of anyone
using the DnsModifyRecordsInSet function. (
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dns/dns/dnsmodifyrecordsinset.asp
)
I know that I have to declare the API in my C# code, and then also the
various types have to be specified. This is where I'm lost. C# doesn't
recognize HANDLE hContext.
Does anyone have any code examples on how to use the
DNSModifyRecordsInSet function from within C#? Any assistance would be
greatly appreciated.
Screenbert