terça-feira, 14 de junho de 2011

Blogging Knowledge - my view about sharing information

The Internet is an amazing place for learning, fun, work, get money (for some lucky and smart guys even get billionaire!). I think that sharing information is the root from what Internet is for. Since the old times when just research and universities had access the Internet was a place to share knowledge.

I am creating this blog to do this: share knowledge and document procedures that I know I will quickly forget, wasting hours of research. With this action I hope some poor soul will find here the solution for its problems and be happy as I am when I find something really useful to solve my problems on the net. Is really nice to see when you can share your problems and see that they are not just yours.

What will this blog talk about? Technology, technologies and computer science research topics like:
  • Windows Server
  • Active Directory
  • Network Servers (DHCP, DNS, Firewalls)
  • Linux
  • FreeBSD
  • Programming: VBA, VB.NET, C#, PowerShell, VBScript, PHP, Perl, Shell Script (bash)
  • Cloud Computing
  • Open Source (yes, this is an open minded blog, Windows mixing with Linux and other topics)
  • A lot more :)
I just hope I can keep this blog running. The blog will be most in English, maybe some topics in Brazilian Portuguese (PT-BR).

segunda-feira, 13 de junho de 2011

Quick Recipe: Exporting Active Directory informatin using CSVDE


CSVDE is a very nice tool to export information from AD DS. It allows you to perform queries in the LDAP context and export the results into nice CSV files, much easier to parse with other language or with Excel (or other spreadsheet solution).

To see all options from CSVDE just type it in the Command Prompt or Power Shell (I prefer Power Shell console).

So let's go: how to export all Users from my Domain? With the command:
csvde -d "dc=example,dc=com" -f example-com.csv -r
"(&(objectclass=user)(objectcategory=person))" -l "DN"

To export the logins use the following command:
csvde -d "dc=example,dc=com" -f example-com.csv -r
"(&(objectclass=user)(objectcategory=person))" -l "userPrincipalName"

DN and userPrincipalName will be exported.

Command analysis:
  • -d option is where you want to look for your info, in the entire domain, one specific OU etc.
  • -f specifies the output file
  • -r is the advanced filter for LDAP search
  • -l is the fields limitation from the search, in this case I just want the DN's.
Further information: