WMI and Create Host(A) Record

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • vbnetdev

    #1

    WMI and Create Host(A) Record

    This code does not work. I would appreciate any suggestions. I have to
    specify a domain name that is not even in its container otherwise it objects
    with errors abotu the method being invalid at GetMethodParame ters. I have
    been able to create the zone and nameservers using similar methods without a
    problem. I am beginning to wonder if it is even possible.

    Dim classInstance20 As New ManagementObjec t( _
    "root\Microsoft DNS", _
    "MicrosoftDNS_A Type.ContainerN ame='existingdo main.com',DnsSe rverName='serve r.DOMAIN.ds',Do mainName='exist ingdomain.com', OwnerName='www. existingdomain. com',RecordClas s='1',RecordDat a='10.10.10.10' ",
    _
    Nothing)

    ' Obtain [in] parameters for the method
    Dim inParamsAREC As ManagementBaseO bject = _
    classInstance20 .GetMethodParam eters("CreateIn stanceFromPrope rtyData")
    ' Add the input parameters.
    inParamsAREC("C ontainerName") = "abcd.com"
    inParamsAREC("D nsServerName") = "server.DOMAIN. ds"
    inParamsAREC("I PAddress") = "10.10.10.1 0"
    inParamsAREC("O wnerName") = "www"
    inParamsAREC("R ecordClass") = 1
    inParamsAREC("T TL") = 0
    ' Execute the method and obtain the return values.
    Dim outParamsAREC As ManagementBaseO bject = _
    classInstance.I nvokeMethod("Cr eateInstanceFro mPropertyData",
    inParamsAREC, Nothing)
    ASPNET_MsgBox(" INVALID METHOD HERE")


    --
    Get a powerful web, database, application, and email hosting with KJM
    Solutions





  • vbnetdev

    #2
    Re: WMI and Create Host(A) Record

    I figured it out. I referred to teh wrong class.

    Does anyone have a code example that shows how to make an entry in the
    reverse lookup for the host record created? Assuming reverse lookup zone
    already exists. I know when you do it manually through the gui it does it
    for you.

    --
    Get a powerful web, database, application, and email hosting with KJM
    Solutions




    "vbnetdev" <vbnetdev@commu nity.nospam> wrote in message
    news:uiXuteoOGH A.2888@tk2msftn gp13.phx.gbl...[color=blue]
    > This code does not work. I would appreciate any suggestions. I have to
    > specify a domain name that is not even in its container otherwise it
    > objects with errors abotu the method being invalid at GetMethodParame ters.
    > I have been able to create the zone and nameservers using similar methods
    > without a problem. I am beginning to wonder if it is even possible.
    >
    > Dim classInstance20 As New ManagementObjec t( _
    > "root\Microsoft DNS", _
    >
    > "MicrosoftDNS_A Type.ContainerN ame='existingdo main.com',DnsSe rverName='serve r.DOMAIN.ds',Do mainName='exist ingdomain.com', OwnerName='www. existingdomain. com',RecordClas s='1',RecordDat a='10.10.10.10' ",
    > _
    > Nothing)
    >
    > ' Obtain [in] parameters for the method
    > Dim inParamsAREC As ManagementBaseO bject = _
    >
    > classInstance20 .GetMethodParam eters("CreateIn stanceFromPrope rtyData")
    > ' Add the input parameters.
    > inParamsAREC("C ontainerName") = "abcd.com"
    > inParamsAREC("D nsServerName") = "server.DOMAIN. ds"
    > inParamsAREC("I PAddress") = "10.10.10.1 0"
    > inParamsAREC("O wnerName") = "www"
    > inParamsAREC("R ecordClass") = 1
    > inParamsAREC("T TL") = 0
    > ' Execute the method and obtain the return values.
    > Dim outParamsAREC As ManagementBaseO bject = _
    >
    > classInstance.I nvokeMethod("Cr eateInstanceFro mPropertyData", inParamsAREC,
    > Nothing)
    > ASPNET_MsgBox(" INVALID METHOD HERE")
    >
    >
    > --
    > Get a powerful web, database, application, and email hosting with KJM
    > Solutions
    > http://www.kjmsolutions.com
    >
    >
    >
    >[/color]


    Comment

    • vbnetdev

      #3
      Re: WMI and Create Host(A) Record

      Creation of the PTR record is fixed.

      --
      Get a powerful web, database, application, and email hosting with KJM
      Solutions




      "vbnetdev" <vbnetdev@commu nity.nospam> wrote in message
      news:u6OHd2xOGH A.3840@TK2MSFTN GP14.phx.gbl...[color=blue]
      >I figured it out. I referred to teh wrong class.
      >
      > Does anyone have a code example that shows how to make an entry in the
      > reverse lookup for the host record created? Assuming reverse lookup zone
      > already exists. I know when you do it manually through the gui it does it
      > for you.
      >
      > --
      > Get a powerful web, database, application, and email hosting with KJM
      > Solutions
      > http://www.kjmsolutions.com
      >
      >
      >
      > "vbnetdev" <vbnetdev@commu nity.nospam> wrote in message
      > news:uiXuteoOGH A.2888@tk2msftn gp13.phx.gbl...[color=green]
      >> This code does not work. I would appreciate any suggestions. I have to
      >> specify a domain name that is not even in its container otherwise it
      >> objects with errors abotu the method being invalid at
      >> GetMethodParame ters. I have been able to create the zone and nameservers
      >> using similar methods without a problem. I am beginning to wonder if it
      >> is even possible.
      >>
      >> Dim classInstance20 As New ManagementObjec t( _
      >> "root\Microsoft DNS", _
      >>
      >> "MicrosoftDNS_A Type.ContainerN ame='existingdo main.com',DnsSe rverName='serve r.DOMAIN.ds',Do mainName='exist ingdomain.com', OwnerName='www. existingdomain. com',RecordClas s='1',RecordDat a='10.10.10.10' ",
      >> _
      >> Nothing)
      >>
      >> ' Obtain [in] parameters for the method
      >> Dim inParamsAREC As ManagementBaseO bject = _
      >>
      >> classInstance20 .GetMethodParam eters("CreateIn stanceFromPrope rtyData")
      >> ' Add the input parameters.
      >> inParamsAREC("C ontainerName") = "abcd.com"
      >> inParamsAREC("D nsServerName") = "server.DOMAIN. ds"
      >> inParamsAREC("I PAddress") = "10.10.10.1 0"
      >> inParamsAREC("O wnerName") = "www"
      >> inParamsAREC("R ecordClass") = 1
      >> inParamsAREC("T TL") = 0
      >> ' Execute the method and obtain the return values.
      >> Dim outParamsAREC As ManagementBaseO bject = _
      >>
      >> classInstance.I nvokeMethod("Cr eateInstanceFro mPropertyData",
      >> inParamsAREC, Nothing)
      >> ASPNET_MsgBox(" INVALID METHOD HERE")
      >>
      >>
      >> --
      >> Get a powerful web, database, application, and email hosting with KJM
      >> Solutions
      >> http://www.kjmsolutions.com
      >>
      >>
      >>
      >>[/color]
      >
      >[/color]


      Comment

      Working...