Jump to content

Recommended Posts

Posted

I am trying to free up some space on one of our curriculum servers. We have a lot of disabled staff accounts, of those teachers who have left. This means we also have a lot of home directories which could be removed.

 

I am currently trying to use dsquery user to find out which accounts are disabled. So far success...

 

dsquery user ou=staff,dc=chase,dc=local -disabled

 

I now however wish to include the staff accounts home directory in the query, and have come unstuck a little. Is there also anyway of outputting the query results to a csv file or txt file?

 

I know something similiar can be done with csvde, but again, I came unstuck at the LDAP query point...

 

Any help much appreciated.

 

Mark

Posted

you'll need to pipe it into dsget like:

 

dsquery user -disabled | dsget user -samid -hmdir

 

You can split the data up in excel if you redirect the output to a text file (put "> file.txt" at the end of the line above).

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...