خوش آموز درخت تو گر بار دانش بگیرد، به زیر آوری چرخ نیلوفری را


بررسی وضعیت سلامت Domain Controller با استفاده از ابزار Dcdiag

بررسی وضعیت سلامت Domain Controller با استفاده از ابزار Dcdiag
در این آموزش، به شما نشان خواهیم داد که چگونه از ابزار خط فرمان Dcdiag برای انجام چک کردن وضعیت سلامت domain controller استفاده کنید. همچنین یاد خواهیم گرفت که چگونه باید با استفاده از Dcdiag تست DNS را هم انجام دهیم. پس اگر شما هم وضعیت سلامت دامین کنترلر شبکه تان مهم است، با ما تا انتهای پست همراه باشید.

سیستم یکپارچۀ سازمانی راهکار

What is Dcdiag

قبل از اینکه به سراغ کار برویم، بهتر کمی نگاهی به فرمان dcdiag داشته باشیم. Dcdiag یک ابزار خط فرمانی مایکروسافت ویندوز است که می تواند وضعیت domain controllers ها را در یک forest تجزیه و تحلیل کند. شما می توانید تجزیه و تحلیل یک domain controller یا همه DC ها در یک forest را انجام دهید. شاید این فکر به ذهن تان خطور کرده باشد که چطور یک ابزار خط فرمان، واقعا در تست و یافتن مشکلات و مسائل مربوط به domain controllers ها کار می کند. خب واقعا این ابزار این کار را به بهترین شکل انجام میدهد که حتی شاید تعجب هم کنیم. در این لینک به طور کامل در مورد کارهایی که dcdiag قادر به انجام آنهاست، گفته شده است.


How to install Dcdiag

اگر شما رول AD DS را قبلا نصب کرده اید، پس Dcdiag هم در سیستم نصب شده است. اگر شما ابزار Tools Remote Administration Server (RSAT) را نصب کرده اید، Dcdiag باز هم نصب شده است. اگر می خواهید Dcdiag را روی یک سیستم نصب کنید که هیچکدام از رول های فوق را نداشته باشد، می توانید این ابزار را از اینجا دانلود کنید و در سیستم ویندوزی تان نصب کنید.

How to use Dcdiag (examples)

استفاده از ابزار dcdiag بسیار ساده می باشد. چندین سوئیچ command line وجود دارد که می تواند با Dcdiag مورد استفاده قرار گیرد، برای دیدن همه آنها فقط از این دستور زیر استفاده کنید:

Dcdiag /?

برخی سوئیچ هایی که در مثال های ما مورد استفاده قرار گرفته شده را می توانید مشاهده کنید:
/s: dcname switch is used to run Dcdiag against a remote server
/v: switch prints more detailed information about each test
/c: switch means comprehensive, this will run all tests including the dns test.
/q: switch will only print errors. This is useful as dcdiag can display a lot of information, if you want to see just the errors then use this switch.
/f: switch is used to redirect the results to a file.
هنگام اجرای dcdiag احتمالا برخی از خطاها را گزارش می دهد اما این به این معنی نیست که شما با domain controllers ها مشکل دارید.

Example 1: Use /s to run against a remote server

این تمام تست های DC را در برابر سرور ریموت DC1 انجام خواهد داد:
dcdiag /s:DC1

فقط در دستور فوق باید به جای DC1 نام سرور مورد نظر خودتان را جایگزین کنید.

Example 2: Using /v to display more details

سوئیچ V جزئیات بیشتری را نمایش می دهد. این تست همانند تست قبلی است که فقط جزئیات بیشتری در خروجی این دستور نمایش داده خواهد شد:
dcdiag /s:DC1  /v


Example 3: Using /f to save to a log file


با استفاده از سوئیچ f می توانید خروجی دستور را در فایل text ذخیره کنید. اگر قصد review کردن خروجی و لاگها را در زمان دیگری دارید، این دستور مناسب شما است:
dcdiag /s:DC1 /f:c:\it\dcdiag_test.txt

Example 4: Using /a to run against all domain controllers

اگر شما چندین domain controllers داشته باشید و بخواهید همه آنها را به یکباره تست کنید، پس از این دستور استفاده کنید. اگر شما تعداد زیادی domain controllers دارید، خروجی این دستور اطلاعات زیادی را نمایش می دهد. در این شرایط سوئیچ a می تواند به شما کمک کند.
dcdiag /s:DC1 /a

Example 5: Use /q to only display the errors

دستور DCDiag می تواند خروجی زیادی را نمایش دهد. برای تنها نمایش errors ها از این دستور استفاده کنید.
dcdiag /s:DC1 /q

Example 6: Use multiple switches

تمامی دستوراتی که مطلوب مان است به یکباره در یک خط فرمان قرار می دهیم و در آخر از آن خروجی می گیریم:
dcdiag /s:DC1 /c /v /f:c:\it\dcdiag_test.txt

بعد از انجام تست های لازم در مورد دامین کنترلر، حال نوبت به تست DNS می رسد.

How to test DNS with DCDiag

DNS diagnostics همچنین شامل چندین تست می باشد. در اینجا تست هایی انجام می شود که به طور پیش فرض تمام تست ها به تحلیل نام های خارجی اجرا می شوند.

/DnsBasic (basic tests, can’t be skipped)
/DnsForwarders (forwarders and root hints tests)
/DnsDelegation (delegations tests)
/DnsDynamicUpdate (dynamic update tests)
/DnsRecordRegistration (records registration tests)
/DnsResolveExtName (external name resolution test)
/DnsAll (includes all tests above)
/DnsInternetName: (for test /DnsResolveExtName)

برای اجرای یک تست DNS از دستور زیر استفاده کنید:
dcdiag /s:dc1 /test:dns

Example: Dcdiag results from a normal domain controller

خروجی دستور فوق برای یک دامین کنترلر نرمال:
Directory Server Diagnosis
Performing initial setup:
* Identified AD Forest.
Done gathering initial info.

Doing initial required tests

Testing server: Default-First-Site-Name\DC1
Starting test: Connectivity
......................... DC1 passed test Connectivity

Doing primary tests

Testing server: Default-First-Site-Name\DC1
Starting test: Advertising
......................... DC1 passed test Advertising
Starting test: FrsEvent
......................... DC1 passed test FrsEvent
Starting test: DFSREvent
......................... DC1 passed test DFSREvent
Starting test: SysVolCheck
......................... DC1 passed test SysVolCheck
Starting test: KccEvent
......................... DC1 passed test KccEvent
Starting test: KnowsOfRoleHolders
......................... DC1 passed test KnowsOfRoleHolders
Starting test: MachineAccount
......................... DC1 passed test MachineAccount
Starting test: NCSecDesc
......................... DC1 passed test NCSecDesc
Starting test: NetLogons
......................... DC1 passed test NetLogons
Starting test: ObjectsReplicated
......................... DC1 passed test ObjectsReplicated
Starting test: Replications
......................... DC1 passed test Replications
Starting test: RidManager
......................... DC1 passed test RidManager
Starting test: Services
......................... DC1 passed test Services
Starting test: SystemLog ......................... DC1 passed test SystemLog Starting test: VerifyReferences
......................... DC1 passed test VerifyReferences

Running partition tests on : ForestDnsZones
Starting test: CheckSDRefDom
......................... ForestDnsZones passed test CheckSDRefDom
Starting test: CrossRefValidation
......................... ForestDnsZones passed test CrossRefValidation

Running partition tests on : DomainDnsZones
Starting test: CheckSDRefDom
......................... DomainDnsZones passed test CheckSDRefDom
Starting test: CrossRefValidation
......................... DomainDnsZones passed test CrossRefValidation

Running partition tests on : Schema
Starting test: CheckSDRefDom
......................... Schema passed test CheckSDRefDom
Starting test: CrossRefValidation
......................... Schema passed test CrossRefValidation

Running partition tests on : Configuration
Starting test: CheckSDRefDom
......................... Configuration passed test CheckSDRefDom
Starting test: CrossRefValidation
......................... Configuration passed test CrossRefValidation

Running partition tests on : ad
Starting test: CheckSDRefDom
......................... ad passed test CheckSDRefDom
Starting test: CrossRefValidation
......................... ad passed test CrossRefValidation

Running enterprise tests on : ad.activedirectorypro.com
Starting test: LocatorCheck
......................... ad.activedirectorypro.com passed test LocatorCheck
Starting test: Intersite
......................... ad.activedirectorypro.com passed test Intersite


Example: Failed kdc service and NETLOGON Service

اینجا خروجی دستور dcdiag، وقتی دو سرویس kdc و NETLOGON در وضعیت stop قرار دارند. با استفاده سوئیچ q فقط errors ها نمایش داده می شوند:
C:\Users\rallen>dcdiag /s:dc2 /q
Fatal Error:DsGetDcName (DC2) call failed, error 1717
The Locator could not find the server.
......................... DC2 failed test Advertising
kdc Service is stopped on [DC2]
NETLOGON Service is stopped on [DC2]
......................... DC2 failed test Services
Warning: DcGetDcName(GC_SERVER_REQUIRED) call failed, error 1717
A Global Catalog Server could not be located - All GC's are down.
Warning: DcGetDcName(PDC_REQUIRED) call failed, error 1717
A Primary Domain Controller could not be located.
The server holding the PDC role is down.
Warning: DcGetDcName(TIME_SERVER) call failed, error 1717
A Time Server could not be located.
The server holding the PDC role is down.
Warning: DcGetDcName(GOOD_TIME_SERVER_PREFERRED) call failed, error 1717
A Good Time Server could not be located.
Warning: DcGetDcName(KDC_REQUIRED) call failed, error 1717
A KDC could not be located - All the KDCs are down.
......................... ad.activedirectorypro.com failed test LocatorCheck

همین! واقعا هم استفاده از دستور و بکارگیری سوئیچ ها ساده است. DCDiag ابزار ساده اما بسیار قدرتمند برای بررسی و تشخیص مشکلات و بررسی وضعیت سلامت domain controllers ها است. توضیه می وشد که در محیط های کاری خود که دامین کنترلر دارید در بازه های زمانی مشخصی از این ابزار استفاده کنید تا در صورت وجود مشکل در DC از آن اطلاع یابید.

نمایش دیدگاه ها (0 دیدگاه)

دیدگاه خود را ثبت کنید:

انتخاب تصویر ویرایش حذف
توجه! حداکثر حجم مجاز برای تصویر 500 کیلوبایت می باشد.


دسته بندی مطالب خوش آموز