V
vbnetdev
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
OMAIN"
' 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
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

' 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