Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Script to Find DNS Server settings - PART II - please check article at MS web for PART I


Author: Nirmal Sharma

View products that this article applies to.

Summary

You can use below script to find DNS server settings from multiple domain using four authentication sets.

↑ Back to the top


More information

���� SET ComERRSNK=
������������� Echo 7.SNKING Login passed...
��������
������������� SET LOR_Old=Failed
������������� SET LOR_New=Failed
������������� SET AMU_Login=Failed
������������� SET SNK_login=Passed
������������� SET Final_Login=Passed
���������� )

������� ) ELSE (

���������� SET ComERRSRM=
���������� Echo 7.SRM Login passed...
��������
���������� SET LOR_Old=Failed
����� �����SET LOR_New=Failed
���������� SET AMU_Login=Passed
���������� SET Final_Login=Passed
������� )

���� ) ELSE (
��
������� SET ComERR=
���������������
������� Echo 6.LOR Old password Passed...
������� SET LOR_New=Failed
������� SET LOR_old=Passed
��� ����SET Final_Login=Passed
���� )

� ) ELSE (
����
���� SET NewComERR=

���� Echo 5.Currently Logged on user have access...
���� Echo 6.LOR New SRMthentication passed...

���� SET LOR_New=Passed
���� SET Final_Login=Passed
���� SET LOR_Old=Not Checked
� )�����

� IF !Final_Login! == Failed (
����
���� SET DLS_B=
���� SET BIAS_B=
���� SET DLS_A=
���� SET BIAS_A=
���� SET TimeZone_N=
���� SET PSEXEC_TZ=
���� SET Rem_Req=
���� SET AOS_Ver=
���� SET AOS_Folder=
���� SET AOS_Un=
���� SET PSEXEC_SPU=
���� SET Uninst_Fold=
���� SET Os_SRMto_E=

���� Echo 5.Login Failed...user DON'T have access to copy DST Folder.
����
���� Echo %srvname% >> NoAccess.txt

� ) ELSE (

���� Echo 5.Currently Logged in user have access on C:\ drive.

���� Echo 6.Check OS Version and Windows System Folder name...

���� IF exist E:\Nirmal\Dns\Windir.txt Del E:\Nirmal\Dns\Windir.txt
���� IF exist E:\Nirmal\Dns\UnFold.txt Del E:\Nirmal\Dns\UnFold.txt

���� Psexec.exe \\%srvname% cmd.exe /c SET > Windir.txt 2>&1
����
���� FIND /i "windir=C:\WINDOWS" < Windir.txt > DoNotShow.txt 2>&1

���� IF !errorlevel! == 0 (
��������
����� SET AOS_Ver="Windows 2003"
������� Echo 6.OS Version: !AOS_Ver!

���� ) ELSE (
�������
������� SET AOS_Ver="Windows 2000"
������� Echo 6.OS Version: !AOS_Ver!�

� ���)

���� IF exist E:\Nirmal\Dns\Dns.txt Del E:\Nirmal\Dns\Dns.txt
���� IF exist E:\Nirmal\Dns\Othdns.txt Del E:\Nirmal\Dns\Othdns.txt

���� Psexec.exe \\%srvname% Ipconfig /all > Dns.txt 2>&1

���� Find /i "DNS Servers" < Dns.txt > Othdns.txt 2>&1
���� FOR /F "Tokens=*" %%a IN (Othdns.txt) DO SET DNS_CONF=%%a
��
���
REM FOR /F "Tokens=*" %%a IN (othdns.txt) DO (

REM�������� SET DNS_Conf=
REM������ SET DNS_Conf=%%a
REM �������� Echo ,!DNS_Conf!, >> DnsSrv.csv
��������
REM�� )
��

�� )

) ELSE (

� SET ServerStat=Down

� Find /i "Request Timed" < PingResult.txt > DoNotShow.txt

� IF !errorlevel! == 0 (
���� SET ServerStat=Request Timed Out
� ) ELSE (
���� SET ServerStat=Uknown Host
� )

� SET LOR_NEW=
� SET LOR_OLD=
� SET DLS_B=
� SET BIAS_B=
� SET DLS_A=
� SET BIAS_A=
� SET TimeZone_N=
� SET PSEXEC_TZ=
� SET Rem_Req=
� SET PSEXEC_SPU=
� SET DST_Stat=
� SET AOS_Ver=
� SET AOS_Folder=
� SET AOS_Un=
� SET Uninst_Fold=
� SET Os_SRMto_E=
� SET DNS_Conf=
� SET DST_Stat=NotOk
� SET Rem_Req=
� SET ComERR=
� SET NewComERR=
� SET PS_Rem=
� SET REG_Use=
� SET Method_U=
� SET REG_Upload=
� SET Copy_Un_F=
� SET DST_Source=
� SET DST_Dest=
� SET Fold_Drive=
� SET Fold_Loc=
� SET Search_C=
� SET Search_D=
� SET Search_E=
� SET AMU_Login=
� SET ComERRSRM=
� SET Int_Logon=
� SET Loc_Power=
� SET SNK_login=
� SET ComERRSNK=

� Echo %srvname% >> HostsDown.txt
� Echo 3.Reply NOT received from Host %srvname%

)

SET OldSrv=%srvname%

IF [!srvname!] == [] (

� Echo Empty

) ELSE (

ECHO %srvname%, %ServerStat%, %LOR_NEW%, %LOR_OLD%, %AMU_Login%, %SNK_login%, %Final_Login%, %PSEXEC_TZ%, %PS_Rem%, %AOS_Ver%, %Dns_conf%, %NewComERR%, %ComERR%, %ComERRSRM%, %ComERRSNK%, >> Report.csv

� SET ServerStat=Down
� SET Final_login=
� SET LOR_NEW=
� SET Int_Logon=
� SET LOR_OLD=
� SET DLS_B=
� SET BIAS_B=
� SET DLS_A=
� SET BIAS_A=
� SET TimeZone_N=
� SET PSEXEC_TZ=
� SET Rem_Req=
� SET AOS_Ver=
� SET AOS_Folder=
� SET AOS_Un=
� SET Uninst_Fold=
� SET DNS_Conf=
� SET Os_SRMto_E=
� SET DST_Stat=NotOk
� SET Rem_Req=Yes
� SET ComERR=
� SET NewComERR=
� SET PS_Rem=
� SET Method_U=
� SET REG_Use=
� SET REG_Upload=
� SET Copy_Un_F=
� SET DST_Source=
� SET DST_Dest=
� SET Fold_Drive=
� SET Fold_Loc=
� SET Search_C=
� SET Search_D=
� SET Search_E=
� SET AMU_Login=
� SET ComERRSRM=
� SET SNK_login=
� SET ComERRSNK=
� SET Loc_Power=


)

:eof

↑ Back to the top


Properties

COMMUNITY SOLUTIONS CONTENT DISCLAIMER
MICROSOFT CORPORATION AND/OR ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY, RELIABILITY, OR ACCURACY OF THE INFORMATION AND RELATED GRAPHICS CONTAINED HEREIN. ALL SUCH INFORMATION AND RELATED GRAPHICS ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT AND/OR ITS RESPECTIVE SUPPLIERS HEREBY DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THIS INFORMATION AND RELATED GRAPHICS, INCLUDING ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, WORKMANLIKE EFFORT, TITLE AND NON-INFRINGEMENT. YOU SPECIFICALLY AGREE THAT IN NO EVENT SHALL MICROSOFT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY DIRECT, INDIRECT, PUNITIVE, INCIDENTAL, SPECIAL, CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF USE, DATA OR PROFITS, ARISING OUT OF OR IN ANY WAY CONNECTED WITH THE USE OF OR INABILITY TO USE THE INFORMATION AND RELATED GRAPHICS CONTAINED HEREIN, WHETHER BASED ON CONTRACT, TORT, NEGLIGENCE, STRICT LIABILITY OR OTHERWISE, EVEN IF MICROSOFT OR ANY OF ITS SUPPLIERS HAS BEEN ADVISED OF THE POSSIBILITY OF DAMAGES.

↑ Back to the top


Community solutions content disclaimer

Microsoft corporation and/or its respective suppliers make no representations about the suitability, reliability, or accuracy of the information and related graphics contained herein. All such information and related graphics are provided "as is" without warranty of any kind. Microsoft and/or its respective suppliers hereby disclaim all warranties and conditions with regard to this information and related graphics, including all implied warranties and conditions of merchantability, fitness for a particular purpose, workmanlike effort, title and non-infringement. You specifically agree that in no event shall Microsoft and/or its suppliers be liable for any direct, indirect, punitive, incidental, special, consequential damages or any damages whatsoever including, without limitation, damages for loss of use, data or profits, arising out of or in any way connected with the use of or inability to use the information and related graphics contained herein, whether based on contract, tort, negligence, strict liability or otherwise, even if Microsoft or any of its suppliers has been advised of the possibility of damages.

↑ Back to the top


Keywords: KB555981, kbhowto, kbpubtypecca, kbpubmvp

↑ Back to the top

Article Info
Article ID : 555981
Revision : 1
Created on : 9/11/2007
Published on : 9/11/2007
Exists online : False
Views : 397