Set DNS Suffix

User avatar
daniel
Site Admin
Posts: 219
Joined: Tue Jan 09, 2007 9:54 pm
Contact:

Set DNS Suffix

Postby daniel » Wed Mar 28, 2007 12:18 pm

This script allow you to set the default DNS Suffix towards your selected one.

'==========================================================================
'
' VBScript Source File
'
' NAME: DNSSuffix.vbs
'
' AUTHOR: Paessens Daniel , Hewlett-Packard Company
' DATE : 3/28/2007
'
' COMMENT: Set the default DNS suffix for Server
'
'==========================================================================

Option Explicit

Dim oWshShell 'Windows Script Host Shell object

Set oWshShell = CreateObject("WScript.Shell")

sNewName = "DNS Suffix"

'Set DNS Suffix
oWshShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Domain", sNewName

'Restart computer
Dim OpSysSet, OpSys
Set OpSysSet = GetObject("winmgmts:{(Shutdown)}//./root/cimv2").ExecQuery("select * from Win32_OperatingSystem where Primary=true")
For Each OpSys In OpSysSet
OpSys.Reboot()
Next
WScript.Quit


Have fun with it.

D

Return to “VBScript”

Who is online

Users browsing this forum: No registered users and 1 guest