473,407 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

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 ConnectionOptions
connection.Username = "Username"
connection.Password = "PASSWORD"
connection.Authority = "ntlmdomain:DOMAIN"
' connection.Impersonation = ImpersonationLevel.Impersonate
'connection.EnablePrivileges = True

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

scope.Connect()

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

'fails at inParams decaration with access denied error

Dim inParams As ManagementBaseObject = _
classInstance3.GetMethodParameters("CreateZone")
inParams("ZoneName") = ZoneName
inParams("ZoneType") = 0
inParams("DsIntegrated") = True
inParams("DataFileName") = Nothing
inParams("IpAddr") = Nothing
inParams("AdminEmailName") = AdminEmail

Dim outParams As ManagementBaseObject = _
classInstance3.InvokeMethod("CreateZone", 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 3092
Hi,

We will follow this issue in the microsoft.public.win32.programmer.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******@community.nospam> wrote in message
news:uL**************@TK2MSFTNGP15.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 ConnectionOptions
connection.Username = "Username"
connection.Password = "PASSWORD"
connection.Authority = "ntlmdomain:DOMAIN"
' connection.Impersonation = ImpersonationLevel.Impersonate
'connection.EnablePrivileges = True

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

scope.Connect()

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

'fails at inParams decaration with access denied error

Dim inParams As ManagementBaseObject = _
classInstance3.GetMethodParameters("CreateZone")
inParams("ZoneName") = ZoneName
inParams("ZoneType") = 0
inParams("DsIntegrated") = True
inParams("DataFileName") = Nothing
inParams("IpAddr") = Nothing
inParams("AdminEmailName") = AdminEmail

Dim outParams As ManagementBaseObject = _
classInstance3.InvokeMethod("CreateZone", 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
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...
2
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...
1
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...
1
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! ...
0
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...
3
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...
5
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...
3
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,...
15
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.