SlideShare a Scribd company logo
1 of 5
Download to read offline
6/14/2016 DSquery Examples | Command line utility to find objects in Windows Server 2003 /8
http://www.computerperformance.co.uk/Logon/DSquery.htm 1/5
Custom Search
2
 Search
Guy recommends:
Free network monitor
SolarWinds' monitor
makes it easy to check
the performance of your
router or firewall.
Download your free
Network Device
Monitor
DSQuery Command Line Tool for Active Directory 2003
New DS built‐in tools for Windows Server 2003
At last I have found a real useful member of the DS family of utilities.  If I need to
find a user quickly from the command prompt, I call for DSQuery.
DSQuery Examples
Example 1 ­ DSQuery to list all the OUs in your domain
Example 2 ­ DSQuery User
Example 3 ­ To list all your Domain Controllers
Example 4 ­ To query the FSMO roles of your Domain Controllers
Example 5 ­ To find all users whose name begins with smith*
Example 6 ­ To filter the DSQuery output with ­o rdn
  ♦
Example 1 ‐ DSQuery to list all the OUs in your domain
Let us find how many Organizational Units are there in your domain? This command
will produce a listing of all OUs with this command.
 
dsquery ou dc=mydom,dc=com 
or
dsquery ou domainroot
Learning Points
Note 1:  dc does NOT mean domain controller, it means domain context.
Note 2:  The dc commands are not case sensitive, but they dislike spaces. 
dc=mydom,    dc=com will draw an error.
Note 3:  If you haven't got any OUs (Organizational Units), I seriously suggest that
you create some to organize your users.
Note 4:  Best of all, in this scenario, you can substitute domainroot for dc=cp.
Example 2 ‐ To find all users in the default Users folder with DSQuery
In this DSQuery example we just want to trawl the users folder and find out who is in
that container.
New
Imported Sony Xperia
Z5 Compact
|32GB|2GB|4.6"|23MP|5.1MP|
WhiteMobile
PhonesShop nowRs.
26,750
New Imported
Samsung Galaxy A9
32GB 3GB 6.0"
13MP 8MP
GoldMobile
PhonesShop nowRs.
411Like
  ► LDAP   ► For Windows  ► AD Server  ► AD ImportAds by Google
Site Home
Script Sections
DS Services Home
DS Create Users
DS Create Groups
DS Modify Password
DS Query
DS Query User
DS Get
LDAP Properties
Error Codes
Try Engineer's Toolset
Free Permissions
Analyser
Free AD Import Tool
6/14/2016 DSquery Examples | Command line utility to find objects in Windows Server 2003 /8
http://www.computerperformance.co.uk/Logon/DSquery.htm 2/5
Guy's Review of
Computer Tools
 1) Belarc Advisor 
 2) Network Perf Mon
 3) Freeping 
 4) PuTTY 
 5) Bandwidth Analyzer
 6) Secunia
 7) Net­SNMP 
 8) Permission Analyzer
dsquery user cn=users,dc=cp,dc=com 
 
Learning Points
Note 1:  The default users' folder is actually a container object called cn=users.  My
point is if you try ou=users, the command fails.
Note 2:  I queried users, however dsquery requires the singular user, not userS. 
Other objects that you can query are computer (not computers!), group or even
contact.
Challenge 1:  Substitute OU=xyz for cn=users, where xyz is the name of your OU. 
Unfortunately, cn=users domainroot does not work.
Challenge 2:  Substitute computer for user
Guy Recommends:  SolarWinds' Free Bulk Import Tool
Import users from a spreadsheet.  Just provide a list of
the users with their fields in the top row, and save as
.csv file.  Then launch this FREE utility and match your
fields with AD's attributes, click and import the users.
Optionally, you can provide the name of the OU where
the new accounts will be born. Download your FREE
bulk import tool.
If you need more comprehensive software, download a
free trial of SAM (Server & Application Monitor)
Example 3 ‐ DSQuery to list all your Domain Controllers
Suppose you want to list all of your domain controllers, (not computers).  Which
command do you think would supply the information?
dsquery server 
dsquery server domainroot 
dsquery server dc=cp,dc=com
Learning Points
Note 1:  Amazingly, dsquery server, the simplest command get the job done.
Note 2:  I thank Jim D for pointing out that we want here is the singular 'server'. 
Example 4 ‐ To query the FSMO roles of your Domain Controllers
Here is a wonderful command to find the FSMO roles (Flexible Single Master Roles) ­
Guy recommends:
A free trial of
WebHelpDesk
Install a ticket­based
help desk system from
SolarWinds. Download
your free trial
PhonesShop nowRs.
34,250Neu
Sony Xperia C5 Ultra
­ 16 GB ­ White ­
SmartphoneMobile
PhonesShop nowRs.
6/14/2016 DSquery Examples | Command line utility to find objects in Windows Server 2003 /8
http://www.computerperformance.co.uk/Logon/DSquery.htm 3/5
 9) DNS Stuff
10) WinDiff's Compare
hasfsmo.  The arguments, which correspond to the 5 roles are: schema, rid, name,
infr and pdc.
 
dsquery server ­hasfsmo schema
Learning Points
Note 1:  The command is ­hasfsmo  not ?hasfsmo as in some documents.
 »
Example 5 ‐ DSQuery to find all users whose name begins with smith*
This DSQuery example shows two ways to filter your output and so home in on what you are looking for.  Let us
pretend that we know the user's name but have no idea which OU they are to be found.  Moreover, we are not
sure whether their name is spelt Smith, Smithy or Smithye.
 
dsquery user domainroot ­name smith* 
or
dsquery user dc=cp,dc=com ­name smith* d 
or plain
dsquery user smith*
Learning Points
Note 1:  Remember to type the singular user.
Note 2:  Probably no need to introduce *, you probably realize it's a wildcard.
Note 3:  ­name is but one of a family of filters. ­desc or ­disabled are others.
Guy Recommends: Permissions Analyzer ‐ Free Active Directory Tool
I like the Permissions Monitor because it enables me to see quickly WHO has permissions to do WHAT.  When
you launch this tool it analyzes a users effective NTFS permissions for a specific file or folder, takes into account
network share access, then displays the results in a nifty desktop dashboard!
Think of all the frustration that this free utility saves when you are troubleshooting authorization problems for
users access to a resource.  Give this permissions monitor a try ­ it's free!
Download Permissions Analyser ­ Free Active Directory Tool
Deal: New Imported Sony Xperia Z5 Compact |32GB|2GB|4.6"|23MP|5.1MP BlackMobile
This website uses cookies to improve user experience. By using our website you consent to all cookies in accordance with our Cookie Policy.
  Read more I agree
6/14/2016 DSquery Examples | Command line utility to find objects in Windows Server 2003 /8
http://www.computerperformance.co.uk/Logon/DSquery.htm 4/5
Custom Search
2If you like this page then please share it with your friends
Example 6 ‐ DSQuery to filter the output with ‐o rdn
The purpose of ­o rdn is to reduce the output to just the relative distinguished
name.  In a nutshell rdn strips away the OU=, DC= part which you may not be
interested in.
dsquery user ­name smith* ­o rdn
Learning Points
Note 1:  o is the letter oh (not a number).  In my minds eye o stands for output.
Note 2:  There is a switch ­o dn, but this is not a switch I use. 
Summary ‐ DSQuery
Knowledge is power.  The DS family in general and DSQuery in particular, are handy commands for interrogating
Active Directory from the command line.  Perhaps the day will come when you need to find a user, computer or
group without calling for the Active Users and Computers GUI.  Next try DSGet.
 
See more of the DS family of built‐in Active Directory utilities
• DSQuery   • DSQuery User   • DSQuery Group    • Free Import CSV Tool
• DSGet ­ List the properties of an object   • DS Commands   • WSH ­ Create a user
• DSMod ­ Modify Active Directory attributes    • DSAdd ­ Create new accounts
 *
  Search
Site Home
Guy Recommends: WMI Monitor for Powershell
Windows Management Instrumentation
(WMI) is most useful for PowerShell
scripting.
SolarWinds have produced this Free
WMI Monitor to take the guess work
out of which WMI counters to use for
applications like Microsoft Active
Directory, SQL or Exchange Server.
Download your free copy of WMI Monitor
Like
  ► Windows Free   ► For Windows   ► Active Directory   ► LDAPAds by Google
This website uses cookies to improve user experience. By using our website you consent to all cookies in accordance with our Cookie Policy.
  Read more I agree
6/14/2016 DSquery Examples | Command line utility to find objects in Windows Server 2003 /8
http://www.computerperformance.co.uk/Logon/DSquery.htm 5/5
Author: Guy Thomas Copyright © 1999­2016 Computer Performance LTD All rights reserved.
Please report a broken link, or an error to: guyc@computerperformance.co.uk
This website uses cookies to improve user experience. By using our website you consent to all cookies in accordance with our Cookie Policy.
  Read more I agree

More Related Content

Similar to D squery examples command line utility to find objects in windows server 2003 _8

C# and Borland StarTeam Connectivity
C# and Borland StarTeam ConnectivityC# and Borland StarTeam Connectivity
C# and Borland StarTeam ConnectivityShreesha Rao
 
Bruh! Do you even diff?—Diffing Microsoft Patches to Find Vulnerabilities
Bruh! Do you even diff?—Diffing Microsoft Patches to Find VulnerabilitiesBruh! Do you even diff?—Diffing Microsoft Patches to Find Vulnerabilities
Bruh! Do you even diff?—Diffing Microsoft Patches to Find VulnerabilitiesPriyanka Aash
 
Active directory domain administration tools
Active directory domain administration toolsActive directory domain administration tools
Active directory domain administration toolsImran Khan
 
Windows sys admin interview questions
Windows sys admin interview questionsWindows sys admin interview questions
Windows sys admin interview questionsStudent
 
Domain Access Module
Domain Access ModuleDomain Access Module
Domain Access ModuleRyan Cross
 
PowerShell for Cyber Warriors - Bsides Knoxville 2016
PowerShell for Cyber Warriors - Bsides Knoxville 2016PowerShell for Cyber Warriors - Bsides Knoxville 2016
PowerShell for Cyber Warriors - Bsides Knoxville 2016Russel Van Tuyl
 
Shared Coursework in Cyber Security Instructions Manual .docx
Shared Coursework in Cyber Security Instructions Manual .docxShared Coursework in Cyber Security Instructions Manual .docx
Shared Coursework in Cyber Security Instructions Manual .docxedgar6wallace88877
 
Power shell training
Power shell trainingPower shell training
Power shell trainingDavid Brabant
 
Linux admin interview questions
Linux admin interview questionsLinux admin interview questions
Linux admin interview questionsKavya Sri
 
Drush 5.0 (DrupalCamp LA 2012) - Chris Charlton
Drush 5.0 (DrupalCamp LA 2012) - Chris CharltonDrush 5.0 (DrupalCamp LA 2012) - Chris Charlton
Drush 5.0 (DrupalCamp LA 2012) - Chris CharltonChris Charlton
 
10 resource kit remote administration tools
10 resource kit remote administration tools10 resource kit remote administration tools
10 resource kit remote administration toolsDuggesh Talawar
 
29041329 interview-questions-for-server-2003
29041329 interview-questions-for-server-200329041329 interview-questions-for-server-2003
29041329 interview-questions-for-server-2003rafiq123
 
Ctive directory interview question and answers
Ctive directory interview question and answersCtive directory interview question and answers
Ctive directory interview question and answerssankar palla
 

Similar to D squery examples command line utility to find objects in windows server 2003 _8 (20)

Windows server Interview question and answers
Windows server Interview question and answersWindows server Interview question and answers
Windows server Interview question and answers
 
C# and Borland StarTeam Connectivity
C# and Borland StarTeam ConnectivityC# and Borland StarTeam Connectivity
C# and Borland StarTeam Connectivity
 
Bruh! Do you even diff?—Diffing Microsoft Patches to Find Vulnerabilities
Bruh! Do you even diff?—Diffing Microsoft Patches to Find VulnerabilitiesBruh! Do you even diff?—Diffing Microsoft Patches to Find Vulnerabilities
Bruh! Do you even diff?—Diffing Microsoft Patches to Find Vulnerabilities
 
Basic Unix
Basic UnixBasic Unix
Basic Unix
 
Active directory domain administration tools
Active directory domain administration toolsActive directory domain administration tools
Active directory domain administration tools
 
Windows sys admin interview questions
Windows sys admin interview questionsWindows sys admin interview questions
Windows sys admin interview questions
 
Domain Access Module
Domain Access ModuleDomain Access Module
Domain Access Module
 
PowerShell for Cyber Warriors - Bsides Knoxville 2016
PowerShell for Cyber Warriors - Bsides Knoxville 2016PowerShell for Cyber Warriors - Bsides Knoxville 2016
PowerShell for Cyber Warriors - Bsides Knoxville 2016
 
Shared Coursework in Cyber Security Instructions Manual .docx
Shared Coursework in Cyber Security Instructions Manual .docxShared Coursework in Cyber Security Instructions Manual .docx
Shared Coursework in Cyber Security Instructions Manual .docx
 
Power shell training
Power shell trainingPower shell training
Power shell training
 
Solaris basics
Solaris basicsSolaris basics
Solaris basics
 
Linux admin interview questions
Linux admin interview questionsLinux admin interview questions
Linux admin interview questions
 
Drush 5.0 (DrupalCamp LA 2012) - Chris Charlton
Drush 5.0 (DrupalCamp LA 2012) - Chris CharltonDrush 5.0 (DrupalCamp LA 2012) - Chris Charlton
Drush 5.0 (DrupalCamp LA 2012) - Chris Charlton
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Linux commands
Linux commandsLinux commands
Linux commands
 
10 resource kit remote administration tools
10 resource kit remote administration tools10 resource kit remote administration tools
10 resource kit remote administration tools
 
29041329 interview-questions-for-server-2003
29041329 interview-questions-for-server-200329041329 interview-questions-for-server-2003
29041329 interview-questions-for-server-2003
 
Tools kali
Tools kaliTools kali
Tools kali
 
Ctive directory interview question and answers
Ctive directory interview question and answersCtive directory interview question and answers
Ctive directory interview question and answers
 

Recently uploaded

Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Sonam Pathan
 
Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170Sonam Pathan
 
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一Fs
 
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书zdzoqco
 
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作ys8omjxb
 
PHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationPHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationLinaWolf1
 
Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Excelmac1
 
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)Christopher H Felton
 
Contact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New DelhiContact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New Delhimiss dipika
 
Film cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasaFilm cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasa494f574xmv
 
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Dana Luther
 
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一Fs
 
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一Fs
 
Top 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxTop 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxDyna Gilbert
 
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一Fs
 
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012rehmti665
 
Magic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMagic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMartaLoveguard
 

Recently uploaded (20)

young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
 
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
 
Model Call Girl in Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in  Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in  Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
 
Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170
 
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
 
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
 
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
 
PHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationPHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 Documentation
 
Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...
 
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
 
Contact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New DelhiContact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New Delhi
 
Hot Sexy call girls in Rk Puram 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in  Rk Puram 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in  Rk Puram 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Rk Puram 🔝 9953056974 🔝 Delhi escort Service
 
Film cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasaFilm cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasa
 
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
 
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
 
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
 
Top 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxTop 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptx
 
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
 
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
 
Magic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMagic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptx
 

D squery examples command line utility to find objects in windows server 2003 _8

  • 1. 6/14/2016 DSquery Examples | Command line utility to find objects in Windows Server 2003 /8 http://www.computerperformance.co.uk/Logon/DSquery.htm 1/5 Custom Search 2  Search Guy recommends: Free network monitor SolarWinds' monitor makes it easy to check the performance of your router or firewall. Download your free Network Device Monitor DSQuery Command Line Tool for Active Directory 2003 New DS built‐in tools for Windows Server 2003 At last I have found a real useful member of the DS family of utilities.  If I need to find a user quickly from the command prompt, I call for DSQuery. DSQuery Examples Example 1 ­ DSQuery to list all the OUs in your domain Example 2 ­ DSQuery User Example 3 ­ To list all your Domain Controllers Example 4 ­ To query the FSMO roles of your Domain Controllers Example 5 ­ To find all users whose name begins with smith* Example 6 ­ To filter the DSQuery output with ­o rdn   ♦ Example 1 ‐ DSQuery to list all the OUs in your domain Let us find how many Organizational Units are there in your domain? This command will produce a listing of all OUs with this command.   dsquery ou dc=mydom,dc=com  or dsquery ou domainroot Learning Points Note 1:  dc does NOT mean domain controller, it means domain context. Note 2:  The dc commands are not case sensitive, but they dislike spaces.  dc=mydom,    dc=com will draw an error. Note 3:  If you haven't got any OUs (Organizational Units), I seriously suggest that you create some to organize your users. Note 4:  Best of all, in this scenario, you can substitute domainroot for dc=cp. Example 2 ‐ To find all users in the default Users folder with DSQuery In this DSQuery example we just want to trawl the users folder and find out who is in that container. New Imported Sony Xperia Z5 Compact |32GB|2GB|4.6"|23MP|5.1MP| WhiteMobile PhonesShop nowRs. 26,750 New Imported Samsung Galaxy A9 32GB 3GB 6.0" 13MP 8MP GoldMobile PhonesShop nowRs. 411Like   ► LDAP   ► For Windows  ► AD Server  ► AD ImportAds by Google Site Home Script Sections DS Services Home DS Create Users DS Create Groups DS Modify Password DS Query DS Query User DS Get LDAP Properties Error Codes Try Engineer's Toolset Free Permissions Analyser Free AD Import Tool
  • 2. 6/14/2016 DSquery Examples | Command line utility to find objects in Windows Server 2003 /8 http://www.computerperformance.co.uk/Logon/DSquery.htm 2/5 Guy's Review of Computer Tools  1) Belarc Advisor   2) Network Perf Mon  3) Freeping   4) PuTTY   5) Bandwidth Analyzer  6) Secunia  7) Net­SNMP   8) Permission Analyzer dsquery user cn=users,dc=cp,dc=com    Learning Points Note 1:  The default users' folder is actually a container object called cn=users.  My point is if you try ou=users, the command fails. Note 2:  I queried users, however dsquery requires the singular user, not userS.  Other objects that you can query are computer (not computers!), group or even contact. Challenge 1:  Substitute OU=xyz for cn=users, where xyz is the name of your OU.  Unfortunately, cn=users domainroot does not work. Challenge 2:  Substitute computer for user Guy Recommends:  SolarWinds' Free Bulk Import Tool Import users from a spreadsheet.  Just provide a list of the users with their fields in the top row, and save as .csv file.  Then launch this FREE utility and match your fields with AD's attributes, click and import the users. Optionally, you can provide the name of the OU where the new accounts will be born. Download your FREE bulk import tool. If you need more comprehensive software, download a free trial of SAM (Server & Application Monitor) Example 3 ‐ DSQuery to list all your Domain Controllers Suppose you want to list all of your domain controllers, (not computers).  Which command do you think would supply the information? dsquery server  dsquery server domainroot  dsquery server dc=cp,dc=com Learning Points Note 1:  Amazingly, dsquery server, the simplest command get the job done. Note 2:  I thank Jim D for pointing out that we want here is the singular 'server'.  Example 4 ‐ To query the FSMO roles of your Domain Controllers Here is a wonderful command to find the FSMO roles (Flexible Single Master Roles) ­ Guy recommends: A free trial of WebHelpDesk Install a ticket­based help desk system from SolarWinds. Download your free trial PhonesShop nowRs. 34,250Neu Sony Xperia C5 Ultra ­ 16 GB ­ White ­ SmartphoneMobile PhonesShop nowRs.
  • 3. 6/14/2016 DSquery Examples | Command line utility to find objects in Windows Server 2003 /8 http://www.computerperformance.co.uk/Logon/DSquery.htm 3/5  9) DNS Stuff 10) WinDiff's Compare hasfsmo.  The arguments, which correspond to the 5 roles are: schema, rid, name, infr and pdc.   dsquery server ­hasfsmo schema Learning Points Note 1:  The command is ­hasfsmo  not ?hasfsmo as in some documents.  » Example 5 ‐ DSQuery to find all users whose name begins with smith* This DSQuery example shows two ways to filter your output and so home in on what you are looking for.  Let us pretend that we know the user's name but have no idea which OU they are to be found.  Moreover, we are not sure whether their name is spelt Smith, Smithy or Smithye.   dsquery user domainroot ­name smith*  or dsquery user dc=cp,dc=com ­name smith* d  or plain dsquery user smith* Learning Points Note 1:  Remember to type the singular user. Note 2:  Probably no need to introduce *, you probably realize it's a wildcard. Note 3:  ­name is but one of a family of filters. ­desc or ­disabled are others. Guy Recommends: Permissions Analyzer ‐ Free Active Directory Tool I like the Permissions Monitor because it enables me to see quickly WHO has permissions to do WHAT.  When you launch this tool it analyzes a users effective NTFS permissions for a specific file or folder, takes into account network share access, then displays the results in a nifty desktop dashboard! Think of all the frustration that this free utility saves when you are troubleshooting authorization problems for users access to a resource.  Give this permissions monitor a try ­ it's free! Download Permissions Analyser ­ Free Active Directory Tool Deal: New Imported Sony Xperia Z5 Compact |32GB|2GB|4.6"|23MP|5.1MP BlackMobile This website uses cookies to improve user experience. By using our website you consent to all cookies in accordance with our Cookie Policy.   Read more I agree
  • 4. 6/14/2016 DSquery Examples | Command line utility to find objects in Windows Server 2003 /8 http://www.computerperformance.co.uk/Logon/DSquery.htm 4/5 Custom Search 2If you like this page then please share it with your friends Example 6 ‐ DSQuery to filter the output with ‐o rdn The purpose of ­o rdn is to reduce the output to just the relative distinguished name.  In a nutshell rdn strips away the OU=, DC= part which you may not be interested in. dsquery user ­name smith* ­o rdn Learning Points Note 1:  o is the letter oh (not a number).  In my minds eye o stands for output. Note 2:  There is a switch ­o dn, but this is not a switch I use.  Summary ‐ DSQuery Knowledge is power.  The DS family in general and DSQuery in particular, are handy commands for interrogating Active Directory from the command line.  Perhaps the day will come when you need to find a user, computer or group without calling for the Active Users and Computers GUI.  Next try DSGet.   See more of the DS family of built‐in Active Directory utilities • DSQuery   • DSQuery User   • DSQuery Group    • Free Import CSV Tool • DSGet ­ List the properties of an object   • DS Commands   • WSH ­ Create a user • DSMod ­ Modify Active Directory attributes    • DSAdd ­ Create new accounts  *   Search Site Home Guy Recommends: WMI Monitor for Powershell Windows Management Instrumentation (WMI) is most useful for PowerShell scripting. SolarWinds have produced this Free WMI Monitor to take the guess work out of which WMI counters to use for applications like Microsoft Active Directory, SQL or Exchange Server. Download your free copy of WMI Monitor Like   ► Windows Free   ► For Windows   ► Active Directory   ► LDAPAds by Google This website uses cookies to improve user experience. By using our website you consent to all cookies in accordance with our Cookie Policy.   Read more I agree