Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create dns with MS script

Status
Not open for further replies.

snakpak

Programmer
Feb 7, 2007
5
CA
Hi,
I want to create my dns with these script and I obtain this error when I try it.
dnsressource.vbs(5155, 1)SWbemLocator: User credentials cannot be used for local connections

and

Error 0x1A8 occurred in connecting to server xxx. Error description: Object required. Verify the server name, credentials and WBEM Core.

can someone help me??????
 
I think the problem with this is that the scripts (managing a DNS server)are for a DNS server that is already created (the link you provided). If you are looking at creating a DNS, the best solution is to step through the Microsoft install process as outlined in step 3 below:

 
I know how to do that manualy, but I have to create the dns automaticly when someone register a new domain
 
OK, that got me to the MSDN page. Still no code, I don't know what you are trying to do nor do I know what is causing your error at line 5155 character 1.

 
Are you trying to automate the creation of new Zones? If so what triggers the script (manual or event). If event driving what user account does the script run under? Does that account have authority to create a Zone on your DNS server?
 

I use my admin account, so Yes my user can create account.

I made a batch file who exec the .vbs and eventually I will put it on the web to create my dns.

This is my batch file, change XXX for the dns address

cscript E:\script\dnszones.vbs Create Primary Forward %domainname% /S XXX /U user /W password
cscript E:\script\dnsrecord.vbs /add A %domainname% /S XXX /U user /W password
cscript E:\script\dnsrecord.vbs /add A %domainname% mail 66.46.%rangeip%.%ipwww% /S XXX /U user /W password
cscript E:\script\dnsrecord.vbs /add A %domainname% lists 66.46.%rangeip%.%ipwww% /S XXX /U user /W password
cscript E:\script\dnsrecord.vbs /add A %domainname% webmail 66.46.%rangeip%.%ipwww% /S XXX /U user /W password
cscript E:\script\dnsrecord.vbs /add A %domainname% ftp 66.46.%rangeip%.%ipwww% /S XXX /U user /W password
cscript E:\script\dnsrecord.vbs /add A %domainname% @ 66.46.%rangeip%.%ipwww% /S XXX /U user /W password

cscript E:\script\dnsrecord.vbs /add PTR %rangeip%.46.66.in-addr.arpa %ipmail% mail.%domainname%. /S XXX /U user /W password

cscript E:\script\dnsrecord.vbs /add MX %domainname% @ mail 10 /S XXX /U user /W password

cscript E:\script\dnszones.vbs Create Secondary Forward %domainname% XXX /S XXX /U user /W password
 
The links are helpful, but which one are you using? You are pointing us to a page with multiple scripts on it, so don't really know which one you are using.
 
I copied all scripts on my .vbs . In dnszones.vbs, I don't know where the script are bugging, but in dnsressource.vbs the script are bugging on Set objService = objLocator.ConnectServer (strServer, strNameSpace, strUserName, strPassword
 
I'm not sure I understand you correctly. Are you saying that you have one script with all of the other scripts in there?

As far as the dnsressource.vbs that errors on the line Set objService = objLocator.ConnectServer (strServer, strNameSpace, strUserName, strPassword.......what is the error it spits out?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top