473,773 Members | 2,315 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Remote DNS Zone Creation with WMI and VB.NET

Hello All:

This is crossposted to 2 WMI groups as they subject matter is relevant to
their focus. I apologize in advance if it offends anyone.

This code is giving access denied errors ("Access is denied. (Exception from
HRESULT: 0x80070005 (E_ACCESSDENIED ))") when attempted to be done from a
remote IP. It works if performed locally. Please advise what permissions
must be changed to allow it to work remotely. IN addition, any attempt to
set the IP address in the parameters fails with a cast error. I am assuming
it is because the IP address property is some sort of collection. I have had
to leave it at 'Nothing' in order to create a zone locally. Then I have to
modify the SOA. If there is a way to set it correctly intiailly that would
be desirable.

Also, where are the other properties? AllowUpdates, Aging and such? I see
the ability to query them in Microsoft_DNS Zone but no methods to set them.

Thank You.

Function TryToWork() As Boolean
Dim connection As New ConnectionOptio ns
connection.User name = "Username"
connection.Pass word = "PASSWORD"
connection.Auth ority = "ntlmdomain:DOM AIN"
' connection.Impe rsonation = ImpersonationLe vel.Impersonate
'connection.Ena blePrivileges = True

Dim scope As New ManagementScope ( _
"\\" & IPAddress & "\root\Microsof tDNS", connection)

scope.Connect()

Dim classInstance3 As New ManagementClass ( _
CStr(scope.Path .ToString), _
"MicrosoftDNS_Z one", Nothing)

'fails at inParams decaration with access denied error

Dim inParams As ManagementBaseO bject = _
classInstance3. GetMethodParame ters("CreateZon e")
inParams("ZoneN ame") = ZoneName
inParams("ZoneT ype") = 0
inParams("DsInt egrated") = True
inParams("DataF ileName") = Nothing
inParams("IpAdd r") = Nothing
inParams("Admin EmailName") = AdminEmail

Dim outParams As ManagementBaseO bject = _
classInstance3. InvokeMethod("C reateZone", inParams, Nothing)

End Function

--
Get a powerful web, database, application, and email hosting with KJM
Solutions
http://www.kjmsolutions.com


Feb 21 '06 #1
2 3102
Hi,

We will follow this issue in the microsoft.publi c.win32.program mer.wmi
newsgroup. If you have any more concerns on it, please check it there.

Thanks for your understanding!

Best regards,

Gary Chang
Microsoft Community Support
=============== =============== =============== =========
PLEASE NOTE the newsgroup SECURE CODE and PASSWORD will be updated at 9:00
AM PST, February 14, 2006. Please complete a re-registration process by
entering the secure code mmpng06 when prompted. Once you have entered the
secure code mmpng06, you will be able to update your profile and access the
partner newsgroups.
=============== =============== =============== =========
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from this issue.
=============== =============== =============== =========
This posting is provided "AS IS" with no warranties, and confers no rights.
=============== =============== =============== =========

Feb 22 '06 #2
Is the user running the script in the DNS Admin group?
"vbnetdev" <vb******@commu nity.nospam> wrote in message
news:uL******** ******@TK2MSFTN GP15.phx.gbl...
Hello All:

This is crossposted to 2 WMI groups as they subject matter is relevant to
their focus. I apologize in advance if it offends anyone.

This code is giving access denied errors ("Access is denied. (Exception
from HRESULT: 0x80070005 (E_ACCESSDENIED ))") when attempted to be done
from a remote IP. It works if performed locally. Please advise what
permissions must be changed to allow it to work remotely. IN addition, any
attempt to set the IP address in the parameters fails with a cast error. I
am assuming it is because the IP address property is some sort of
collection. I have had to leave it at 'Nothing' in order to create a zone
locally. Then I have to modify the SOA. If there is a way to set it
correctly intiailly that would be desirable.

Also, where are the other properties? AllowUpdates, Aging and such? I see
the ability to query them in Microsoft_DNS Zone but no methods to set
them.

Thank You.

Function TryToWork() As Boolean
Dim connection As New ConnectionOptio ns
connection.User name = "Username"
connection.Pass word = "PASSWORD"
connection.Auth ority = "ntlmdomain:DOM AIN"
' connection.Impe rsonation = ImpersonationLe vel.Impersonate
'connection.Ena blePrivileges = True

Dim scope As New ManagementScope ( _
"\\" & IPAddress & "\root\Microsof tDNS", connection)

scope.Connect()

Dim classInstance3 As New ManagementClass ( _
CStr(scope.Path .ToString), _
"MicrosoftDNS_Z one", Nothing)

'fails at inParams decaration with access denied error

Dim inParams As ManagementBaseO bject = _
classInstance3. GetMethodParame ters("CreateZon e")
inParams("ZoneN ame") = ZoneName
inParams("ZoneT ype") = 0
inParams("DsInt egrated") = True
inParams("DataF ileName") = Nothing
inParams("IpAdd r") = Nothing
inParams("Admin EmailName") = AdminEmail

Dim outParams As ManagementBaseO bject = _
classInstance3. InvokeMethod("C reateZone", inParams,
Nothing)

End Function

--
Get a powerful web, database, application, and email hosting with KJM
Solutions
http://www.kjmsolutions.com

Mar 18 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
5689
by: mayamorning123 | last post by:
A comparison among six VSS remote tools including SourceOffSite , SourceAnyWhere, VSS Connect, SourceXT, VSS Remoting, VSS.NET To view the full article, please visit http://www.BetterVssRemoting.com Better VSS Remote Access Tool This article makes a detailed comparison among SourceAnyWhere 4.0, SourceOffSite 4.1, VSS Connect 1.5, SourceXT 2.1, VSS Remoting 2.5,
2
1534
by: Ken Allen | last post by:
I folloowed the instructions on configuring the remote debugging capabilities, but I get the following error. I installed the remote debugging components from the .Net install CD on the remote system and then launched the remote debugger, which put up a commandprompt window. I then configured my local project and hit F5 -- the program seemed to launch, and a command prompt was displayed on the remote console (I have my service running as a...
1
1499
by: Karunakaran | last post by:
Is there a way to allow asp.net to create a folder in remote server? Say if I give a path something like this: \\testserver\testfolder the asp.net application sould be able to create folder "testfolder" in the machine named "testserver" Any ideas or suggestions?
1
3084
by: Ken Allen | last post by:
I have encountered a problem with remote debugging under VS 2005 and ..Net 2.0 -- it seems that the framework installation does not include the "Microsoft .Net Framework 2.0 Configuration" tool! My preferred method of debugging uses these steps: 1. Share the directory that contains the debug image; also share the folder that contains the debug monitor. 2. Configure the project debug mode to launch the exeecutable from the share rather...
0
1813
by: Ken Allen | last post by:
The MSDN documentation on remote debugging is a bit sparse, to say the least, and there is almost no information available on the 'best' way to configure this. I should note that my development system is Windows XP Pro and the test machine is Windows 2003, both running the latest upgrades; Visual Studio 2005 is installed on the development system and the .Net 2.0 framework is installed on the test system. The two systems do not have the...
3
4599
by: Geoff McElhanon | last post by:
I have been struggling with a security issue that occurs under .NET 2.0, but does not occur under .NET 1.1. Essentially I am trying to open up a performance counter on a remote server and monitor its value. In .NET 1.1 this worked fine, however under .NET 2.0 it fails when I am not an administrator on the remote server. To provide a lean demonstration of the issue, I created the following class: ============================
5
2386
by: J_Zanetti | last post by:
Hello everybody, I would need to load through javascript a remote xml file (a rss feed) and then use its content to build the page. I am trying to do something in my local pc and it works fine in IE but in firefox it seems that remote files cannot be retrieved. So how would it be possilbe to build a rss ticker entirely in JS working in firefox? The only solution is an Ajax call?? Thanks very much to anyone who will be able to help me...
3
1417
by: btysgtmajor | last post by:
Hi all, I'm running a Win2003 server w/ IIS 6. The home directory of the website is on a network share. I successfully host html pages and asp apps. However, when it comes to ASP.Net web app, I'm having problems. I believe my permissions are set correctly; however, I don't know too much about setting up "full trust" or anything like that. Furthermore, the error message I get on my ASP.NET application doesn't intuitively seem to point...
15
7088
by: =?Utf-8?B?TVNU?= | last post by:
To demonstrate my problem, I have a very simple VB Windows application. It has a text box that is used to display a counter, a button to reset the counter, and a timer that increments the counter every second. I remote desktop to the computer hosting this application and run the application. It starts up and displays the counter incrementing every second. If I disconnect the network cable between the two computers for 10 seconds and...
0
9621
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10264
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10039
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8937
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5355
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4012
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2852
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.