Como obter o total de registros no meu servidor DNS (Windows Server 2003)

2

Como posso obter o total de registros no meu servidor DNS (Windows Server 2003 - Active Directory Environment)

É possível obter essa informação via Powershell / wmi?

Atualização:

Até agora eu usei isso com o Powershell:

& "d:\AdminTools\SupportTools\Windows2003\dnscmd.exe" SERVERDNS /enumrecords domain.local . > output.txt
gc output.txt | measure-object | select count

Alguma sugestão?

    
por Xavier C 27.01.2010 / 18:47

1 resposta

0

Que tal um arquivo de lote simples ...

@Echo Off
rem Enter the location of the Windows Support Tools below
set @SupportToolsLoc=c:\Program Files\Support Tools

rem Enter the domain name you want to count below
set @DomainName=foo.com

rem Enter DNS Server Name below, or a period for the local server
Set @DNSServer=.

setlocal ENABLEDELAYEDEXPANSION
set /a @RecordCount=0
"%@SupportToolsLoc%\dnscmd" %@DNSServer% /enumrecords %@DomainName% . >DNSRecords.txt
for /f "skip=1 tokens=*" %%f in ('type DNSRecords.txt') do set /a @RecordCount=!@RecordCount! + 1
set /a @RecordCount=!@RecordCount! - 1
If "%@DNSServer%"=="." echo There are !@RecordCount! records in the domain %@DomainName% on the local server
If not "%@DNSServer%"=="." echo There are !@RecordCount! records in the domain %@DomainName% on the DNS Server %@DNSServer%
pause
del /q DNSRecords.txt
endlocal

Espero que isso ajude,

Glenn

    
por 30.08.2010 / 16:40