0
私はコーディングに新しく、探し回ってみました。私の目標は、ネットワーク上のマシンからドメインコントローラをリモートから取得することです。私はバッチ経由で使用しているコマンドは以下の通りです。 DC名のみを表示するようにnltestの結果をフィルタリングします。私は接続状態とフラグを必要としません。バッチコマンドの結果を削除するには
:Start
color 02
cls
@echo off
Echo.
Echo Domain Controller Finder
Echo.
Set /P Computer=Enter the Asset ID:
If "%Computer%"== "" goto BadName
nltest /sc_query:<Domain_Name> /server:%Computer%
pause
Goto End
:BadName
Cls
Echo.
Echo You have entered an incorrect name or left this field blank
Echo Please enter a valid Name or press Ctr-C to exit.
Echo.
Pause
Goto Start
:End