วันพุธที่ 5 มิถุนายน พ.ศ. 2562

Powershell Scripts: Get DNS Record


Powershell Scripts: Get DNS Record


Import-Module dnsshell

##FQDN##
$ServerName = "adhq01.contoso.co.th"

##Domain Name##
$ZoneName = "contoso.co.th"

##Date Time##
$ondate = get-date -Format "ddMMyy"

##Get Dns Record##
##Server Name: adhq01.contoso.co.th##
##Zone Name: contoso.co.th## 
##Record Type: A Record##
##Select: String 10.xxx.xxx.xxx##

$results = Get-DnsRecord -Server $ServerName -ZoneName $ZoneName  -RecordType A | out-string -stream | Select-String "10."


##Out Put to File##
$results >"D:\DNSRecord\DNSRecords$ondate.csv"

ไม่มีความคิดเห็น:

แสดงความคิดเห็น