$a=Read-Host "请输入安装的服务名称:"
ServerManagercmd -install $a $zone="y" $zone=Read-Host "是否需要添加区域(Y/N)?" while($zone -eq "y") { $b=Read-Host "请输入正向搜索区域名称:" $c=Read-Host "请输入正向区域的文件名:" dnscmd /zoneadd $b /primary /file $c $e="y" $e=Read-Host "是否要添加A纪录(Y/N)?" while($e -eq "y") { $f=Read-Host "请输入A纪录对应的主机名(www):" $g=Read-Host "请输入A纪录对应的IP地址:" dnscmd /recordadd $b $f A $g $bm="y" $bm=Read-Host "是否需要创建别名记录?(Y/N)" while($bm -eq "y") { $mz=Read-Host "请输入别名:" $zj=Read-Host "请输入需要创建的别名的主机(www.benet.com):" dnscmd /recordadd $b $mz CNAME $zj $bm=Read-Host "是否需要继续创建别名记录?(Y/N)" } $e=Read-Host "是否需要继续添加A纪录?(Y/N)" } $zone=Read-Host "是否继续添加区域?(Y/N)" } $x="y" $x=Read-Host "是否添加反向区域?(Y/N)" while($x -eq "y") { $h=Read-Host "请输入反向区域的网段及反向后缀名(10.168.192.in-addr.arpa):" dnscmd /zoneadd $h /primary $z="y" $z=Read-Host "是否需要添加反向纪录(Y/N):" while($z -eq "y") { $i=Read-Host "请输入反向区域的主机位:" $j=Read-Host "请输入反向区域的域名:" dnscmd /recordadd $h $i PTR $j $z=Read-Host "是否需要继续添加反向纪录(Y/N)" } $x=Read-Host "是否继续添加反向区域?(Y/N)" } $m="y" $m=Read-host "是否向区域内添加子区域?(Y/N)" while($m -eq "y") { $n=Read-host "请输入区域的子域" dnscmd /zoneadd $m /primary $q="y" $q=Read-Host "是否需要添加主机记录?(Y/N)" while($q -eq "y") { $o=Read-Host "请输入主机名称" $p=Read-Host "请输入主机记录(IP)" dnscmd /recordadd $n $o A $p } $q=Read-Host "是否需要继续添加主机记录?(Y/N)" } $m=Read-Host "是否需要继续添加子区域?(Y/N)"