دستوراتی که یک ادمین برای اکتیو دایرکتوری احتیاج دارد
[FONT=times new roman]توجه: در اینجا به طور مثال اسم دومین[/FONT] [FONT=times new roman] Domain [/FONT][FONT=times new roman]ما[/FONT] [FONT=times new roman] Contoso.com [/FONT][FONT=times new roman]میباشد. البته در فرامینی[/FONT] [FONT=times new roman] Commands [/FONT][FONT=times new roman]که احتیاج به نوشتن نام دومین[/FONT] [FONT=times new roman] Domain [/FONT][FONT=times new roman]است[/FONT] [FONT=times new roman] .
[/FONT] [FONT=times new roman] ۱[/FONT] [FONT=times new roman] - [/FONT][FONT=times new roman]پیدا کردن رول های[/FONT] [FONT=times new roman] FSMO[/FONT] [RIGHT][FONT=times new roman]کد[/FONT] [FONT=times new roman] :[/FONT][/RIGHT]
[RIGHT][FONT=courier new]ntdsutil roles Connections "Connect to server %logonserver%" Quit "select Operation Target" "List roles for conn server" Quit Quit Quit[/FONT][/RIGHT]
[RIGHT] [FONT=times new roman] ۲[/FONT] [FONT=times new roman] - [/FONT][FONT=times new roman]پیدا کردن تمام سرورها[/FONT] [FONT=times new roman] Servers [/FONT][FONT=times new roman]در اکتیو دایرکتوری[/FONT] [FONT=times new roman] AD [/FONT][FONT=times new roman]و توضیح آنها[/FONT] [FONT=times new roman] Description[/FONT][/RIGHT]
[RIGHT][FONT=times new roman]کد[/FONT] [FONT=times new roman] :[/FONT]
[/RIGHT]
[RIGHT][FONT=courier new]dsquery * dc=Contoso,dc=Com -filter "(&(objectCategory=Computer)(objectClass=Computer)(operatingSystem=*server*))" -limit 0 -attr cn description[/FONT][/RIGHT]
[RIGHT] [FONT=times new roman] ۳[/FONT] [FONT=times new roman] - [/FONT][FONT=times new roman]پیدا کردن تمام کامپیوترها[/FONT] [FONT=times new roman] Computers [/FONT][FONT=times new roman]در اکتیو دایرکتوری[/FONT] [FONT=times new roman] AD [/FONT][FONT=times new roman]و توضیح آنها[/FONT] [FONT=times new roman] Description[/FONT][/RIGHT]
[RIGHT][FONT=times new roman]کد[/FONT] [FONT=times new roman] :[/FONT][/RIGHT]
[RIGHT][FONT=courier new]dsquery * -filter "(&(objectClass=Computer)(objectCategory=Computer))" "DC=Contoso,DC=Com" -attr cn description[/FONT][/RIGHT]
[RIGHT] [FONT=times new roman] ۴[/FONT] [FONT=times new roman] - [/FONT][FONT=times new roman]چه زمانی اکتیو دایرکتوری[/FONT] [FONT=times new roman] AD [/FONT][FONT=times new roman]اینستال یا ایجاد[/FONT] [FONT=times new roman] Create [/FONT][FONT=times new roman]شده است [/FONT] [/RIGHT]
[RIGHT][FONT=times new roman]کد[/FONT] [FONT=times new roman] :[/FONT][/RIGHT]
[RIGHT][FONT=courier new]dsquery * CN=configuration,DC=Contoso,DC=Com -attr whencreated -scope base[/FONT][/RIGHT]
[RIGHT] [FONT=times new roman] ۵[/FONT] [FONT=times new roman] - [/FONT][FONT=times new roman]دیدن اینکه دومین[/FONT] [FONT=times new roman] Contoso.com [/FONT][FONT=times new roman]با کدام دومین دیگر[/FONT] [FONT=times new roman] Trust Partner [/FONT][FONT=times new roman]است و[/FONT] [FONT=times new roman] Flat Name [/FONT][FONT=times new roman]آن, همان[/FONT] [FONT=times new roman] NetBios Name[/FONT][/RIGHT]
[RIGHT][FONT=times new roman]کد[/FONT] [FONT=times new roman] :[/FONT][/RIGHT]
[RIGHT][FONT=courier new]dsquery * "CN=System,DC=Contoso,DC=Com" -filter "(objectClass=trustedDomain)" -attr TrustPartner FlatName[/FONT][/RIGHT]
[RIGHT] [FONT=times new roman] ۶[/FONT] [FONT=times new roman] - [/FONT][FONT=times new roman]دیدن لیست دومین کنترولر های[/FONT] [FONT=times new roman] DCs [/FONT][FONT=times new roman]موجود در دومین[/FONT] [FONT=times new roman] Contoso.Com [/FONT][FONT=times new roman]به همراه نام[/FONT] [FONT=times new roman] Site [/FONT][FONT=times new roman]ای که داخل آن هستند [/FONT] [/RIGHT]
[RIGHT][FONT=times new roman]کد[/FONT] [FONT=times new roman] :[/FONT][/RIGHT]
[RIGHT][FONT=courier new]Nltest /DCList:%userdnsdomain%[/FONT][/RIGHT]
[RIGHT] [FONT=times new roman] ۷[/FONT] [FONT=times new roman] - [/FONT][FONT=times new roman]لیست اکانتهایی[/FONT] [FONT=times new roman] Accounts [/FONT][FONT=times new roman]که پسورد[/FONT] [FONT=times new roman] Passwords [/FONT][FONT=times new roman]آنها انقضاء[/FONT] [FONT=times new roman] Expiry [/FONT][FONT=times new roman]نمیشود [/FONT] [/RIGHT]
[RIGHT][FONT=times new roman]کد[/FONT] [FONT=times new roman] :[/FONT][/RIGHT]
[RIGHT][FONT=courier new]dsquery * domainroot -filter "(&(objectCategory=Person)(objectClass=User)(userAccountControl:1.2.840.113556.1.4.803:=65536))"[/FONT][/RIGHT]
[RIGHT] [FONT=times new roman] ۸[/FONT] [FONT=times new roman] - [/FONT][FONT=times new roman]لیست اکانتهایی[/FONT] [FONT=times new roman] Accounts [/FONT][FONT=times new roman]که غیر فعال[/FONT] [FONT=times new roman] Disable [/FONT][FONT=times new roman]شده اند [/FONT] [/RIGHT]
[RIGHT][FONT=times new roman]کد[/FONT] [FONT=times new roman] :[/FONT][/RIGHT]
[RIGHT][FONT=courier new]dsquery * domainroot -filter "(&(objectCategory=Person)(objectClass=User)(userAccountControl:1.2.840.113556.1.4.803:=2))"[/FONT][/RIGHT]
[RIGHT] [FONT=times new roman] ۹[/FONT] [FONT=times new roman] - [/FONT][FONT=times new roman]دیدن اینکه کامپیوترها[/FONT] [FONT=times new roman] Computers [/FONT][FONT=times new roman]در کدام[/FONT] [FONT=times new roman] OU [/FONT][FONT=times new roman]در اکتیو دایرکتوری[/FONT] [FONT=times new roman] AD [/FONT][FONT=times new roman]هستند [/FONT] [/RIGHT]
[RIGHT][FONT=times new roman]کد[/FONT] [FONT=times new roman] :[/FONT][/RIGHT]
[RIGHT][FONT=courier new]dsquery computer -limit 0[/FONT][/RIGHT]
[RIGHT] [FONT=times new roman] ۱۰[/FONT] [FONT=times new roman] - [/FONT][FONT=times new roman]دیدن یوزرها[/FONT] [FONT=times new roman] Users [/FONT][FONT=times new roman]در کدام[/FONT] [FONT=times new roman] OU [/FONT][FONT=times new roman]در اکتیو دایرکتوری[/FONT] [FONT=times new roman] AD [/FONT][FONT=times new roman]هستند [/FONT] [/RIGHT]
[RIGHT][FONT=times new roman]کد[/FONT] [FONT=times new roman] :[/FONT][/RIGHT]
[RIGHT][FONT=courier new]dsquery user -limit 0[/FONT][/RIGHT]
[RIGHT] [FONT=times new roman] ۱۱[/FONT] [FONT=times new roman] - [/FONT][FONT=times new roman]دیدن اطلاعات مربوط به[/FONT] [FONT=times new roman] Site [/FONT][FONT=times new roman]ها [/FONT] [/RIGHT]
[RIGHT][FONT=times new roman]کد[/FONT] [FONT=times new roman] :[/FONT][/RIGHT]
[RIGHT][FONT=courier new]dsquery * "CN=Sites,CN=Configuration,DC=Contoso,DC=Com" -attr CN Description Location -filter (objectClass=site)[/FONT][/RIGHT]
[RIGHT] [FONT=times new roman] ۱۲[/FONT] [FONT=times new roman] - [/FONT][FONT=times new roman]دیدن اطلاعات[/FONT] [FONT=times new roman] Cost [/FONT][FONT=times new roman]و[/FONT] [FONT=times new roman] ReplInterval [/FONT][FONT=times new roman]و[/FONT] [FONT=times new roman] Site List [/FONT][FONT=times new roman]مربوط به[/FONT] [FONT=times new roman] Sites [/FONT][FONT=times new roman]ها [/FONT] [/RIGHT]
[RIGHT][FONT=times new roman]کد[/FONT] [FONT=times new roman] :[/FONT][/RIGHT]
[RIGHT][FONT=courier new]dsquery * "CN=Sites,CN=Configuration,DC=Contoso,DC=Com" -attr CN Cost Description ReplInterval SiteList -filter (objectClass=siteLink)[/FONT][/RIGHT]
[RIGHT] [FONT=times new roman] ۱۳[/FONT] [FONT=times new roman] - [/FONT][FONT=times new roman]دیدن[/FONT] [FONT=times new roman] Bridgeheads [/FONT][FONT=times new roman]های دومین [/FONT] [/RIGHT]
[RIGHT][FONT=times new roman]کد[/FONT] [FONT=times new roman] :[/FONT][/RIGHT]
[RIGHT][FONT=courier new]repadmin /bridgeheads[/FONT][/RIGHT]
[RIGHT][FONT=times new roman]
[/FONT] [FONT=times new roman] ۱۴[/FONT][FONT=times new roman]-ساختن 100 یوزر به صورت اتوماتیک در[/FONT] [FONT=times new roman] OU=IT [/FONT] [FONT=times new roman] ، دومین[/FONT] [FONT=times new roman] Contoso.Com[/FONT][/RIGHT]
[RIGHT][FONT=times new roman]کد[/FONT] [FONT=times new roman] :[/FONT][/RIGHT]
[RIGHT][FONT=courier new]for /L %%i IN (1,1,100) DO dsadd user "CN=User%%i,OU=IT,DC=Contoso,DC=Com" -fn User%%i -upn User%%i@Contoso.Com -pwd test%%1u23 -pwdneverexpires yes -canchpwd no[/FONT][/RIGHT]
[RIGHT] [FONT=times new roman] ۱۵[/FONT] [FONT=times new roman] - [/FONT][FONT=times new roman]ساختن 100 یوزر به صورت اتوماتیک در[/FONT] [FONT=times new roman] OU=IT [/FONT] [FONT=times new roman] ، دومین[/FONT] [FONT=times new roman] Contoso.Com [/FONT][FONT=times new roman]با استفاده از اسکریپت[/FONT] [FONT=times new roman] VBScript[/FONT][/RIGHT]
[RIGHT][FONT=times new roman]کد[/FONT] [FONT=times new roman] :[/FONT][/RIGHT]
[RIGHT][FONT=courier new]Set objRootDSE = GetObject("LDAP://rootDSE") [/FONT][/RIGHT]
[RIGHT][FONT=courier new]Set objRootLDAP = GetObject("LDAP://rootDSE")[/FONT][/RIGHT]
[RIGHT][FONT=courier new]Set objContainer = GetObject("LDAP://ou=IT," & _[/FONT][/RIGHT]
[RIGHT][FONT=courier new]objRootLDAP.Get("defaultNamingContext"))[/FONT][/RIGHT]
[RIGHT][FONT=courier new]For i = 1 To 100 [/FONT][/RIGHT]
[RIGHT][FONT=courier new] Set objLeaf = objContainer.Create("User", "cn=UserNo" & i) [/FONT][/RIGHT]
[RIGHT][FONT=courier new] objLeaf.Put "sAMAccountName", "UserNo" & i [/FONT][/RIGHT]
[RIGHT][FONT=courier new] objLeaf.SetInfo [/FONT][/RIGHT]
[RIGHT][FONT=courier new]Next [/FONT][/RIGHT]
[RIGHT][FONT=courier new]WScript.Echo "100 Users created."[/FONT][/RIGHT]
[RIGHT] [FONT=times new roman] ۱۶[/FONT] [FONT=times new roman] - [/FONT][FONT=times new roman]دیدن تمام[/FONT] [FONT=times new roman] replicated attributes [/FONT][FONT=times new roman]در اکتیو دایرکتوری[/FONT] [FONT=times new roman] Schema[/FONT][/RIGHT]
[RIGHT][FONT=times new roman]کد[/FONT] [FONT=times new roman] :[/FONT][/RIGHT]
[RIGHT][FONT=courier new]dsquery * CN=Schema,CN=Configuration,DC=Contoso,DC=Com -filter "(&(objectClass=attributeSchema)(objectCategory=attributeSchema)(!systemFlags:1.2.840.113556.1.4.803:=1))" -limit 0[/FONT][/RIGHT]
[RIGHT] [FONT=times new roman] ۱۷[/FONT] [FONT=times new roman] - [/FONT][FONT=times new roman]دیدن[/FONT] [FONT=times new roman]Garbage Collection [/FONT][FONT=times new roman]و[/FONT] [FONT=times new roman] Tombstone [/FONT][FONT=times new roman]در اکتیو دایرکتوری [/FONT] [/RIGHT]
[RIGHT][FONT=times new roman]کد[/FONT] [FONT=times new roman] :[/FONT][/RIGHT]
[RIGHT][FONT=courier new]dsquery * "CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration,DC=Contoso,DC=Com" -attr GarbageCollPeriod TombstoneLifetime[/FONT][/RIGHT]
[RIGHT] [FONT=times new roman] ۱۸[/FONT] [FONT=times new roman] - [/FONT][FONT=times new roman]دیدن سرورهای[/FONT] [FONT=times new roman] authorised DHCP [/FONT][FONT=times new roman]در اکتیو دایرکتوری [/FONT] [/RIGHT]
[RIGHT][FONT=times new roman]کد[/FONT] [FONT=times new roman] :[/FONT][/RIGHT]
[RIGHT][FONT=courier new]Dsquery * "CN=NetServices,CN=Services,CN=Configuration,DC=Contoso,DC=Com" -attr DHCPServers[/FONT][/RIGHT]
[RIGHT] [FONT=times new roman] ۱۹[/FONT] [FONT=times new roman] - [/FONT][FONT=times new roman]لیست اسامی[/FONT] [FONT=times new roman] SPN [/FONT][FONT=times new roman]سرویسها[/FONT] [FONT=times new roman] Service Principal Names[/FONT][/RIGHT]
[RIGHT][FONT=times new roman]کد[/FONT] [FONT=times new roman] :[/FONT][/RIGHT]
[RIGHT][FONT=courier new]for /f %i in ('dsquery server -domain %userdnsdomain% -o rdn') do setspn -L %i[/FONT][/RIGHT]
[RIGHT] [FONT=times new roman] ۲۰[/FONT] [FONT=times new roman] - [/FONT][FONT=times new roman]لیست از[/FONT] [FONT=times new roman] Subnet [/FONT][FONT=times new roman]ها در دومین [/FONT] [/RIGHT]
[RIGHT][FONT=times new roman]کد[/FONT] [FONT=times new roman] :[/FONT][/RIGHT]
[RIGHT][FONT=courier new]Dsquery subnet -name * -limit 0[/FONT][/RIGHT]
[RIGHT] [FONT=times new roman] ۲۱[/FONT] [FONT=times new roman] - [/FONT][FONT=times new roman]دیدن توپولوژی[/FONT] [FONT=times new roman] Inter-Site [/FONT][FONT=times new roman]سرورها در هر سایت[/FONT] [FONT=times new roman] Site[/FONT][/RIGHT]
[RIGHT][FONT=times new roman]کد[/FONT] [FONT=times new roman] :[/FONT][/RIGHT]
[RIGHT][FONT=courier new]Repadmin /istg * /verbose[/FONT][/RIGHT]
[RIGHT] [FONT=times new roman] ۲۲[/FONT] [FONT=times new roman] - [/FONT][FONT=times new roman]دیدن[/FONT] [FONT=times new roman] GUID [/FONT][FONT=times new roman]های مربوط به هر گروه پالسی[/FONT] [FONT=times new roman] Group Policy[/FONT][/RIGHT]
[RIGHT][FONT=times new roman]کد[/FONT] [FONT=times new roman] :[/FONT][/RIGHT]
[RIGHT][FONT=courier new]dsquery * "CN=Policies,CN=System,DC=Contoso,DC=Com" -filter (objectCategory=groupPolicyContainer) -attr Name DisplayName[/FONT][/RIGHT]
[RIGHT] [FONT=times new roman] ۲۳[/FONT] [FONT=times new roman] - [/FONT][FONT=times new roman]دیدن[/FONT] [FONT=times new roman] Replication Summary[/FONT][/RIGHT]
[RIGHT][FONT=times new roman]کد[/FONT] [FONT=times new roman] :[/FONT][/RIGHT]
[RIGHT][FONT=courier new]Repadmin /replsummary[/FONT][/RIGHT]
[RIGHT] [FONT=times new roman] ۲۴[/FONT] [FONT=times new roman] - [/FONT][FONT=times new roman]دیدن[/FONT] [FONT=times new roman] Replication latency[/FONT][/RIGHT]
[RIGHT][FONT=times new roman]کد[/FONT] [FONT=times new roman] :[/FONT][/RIGHT]
[RIGHT][FONT=courier new]repadmin /latency /verbose
[/FONT]
[/RIGHT]
[FONT=courier new]منبع : [/FONT]microsoft