Jump to content

Recommended Posts

Posted

hey all! I've been looking at clearing these old accounts out - cant really use the tools out there would like to stick with the micorosft tools : So I have been looking at using either

 

dsquery computer -inactive (noofweeks) {doesn't work on my network}

 

and

 

dsquery computer -stalepwd (noofdays) {works ok on my network}

 

which apparently you can pipe with the dsrm command.

 

i can get the list of inactive accounts ok but i cant seem to get the switch right to remove them in that line.

 

have tried

 

dsquery computer -stalepwd 180 ¦ dsrm

 

and it errors with startnode incorrect format.

 

any one out there can show me the light? think i am being a bit blind here!

 

 

ta j

Posted
you can only pipe the output from 'dsquery computer -inactive (weeks)' to dsrm. So you'll have to get that working if that's what you want to do.
Posted

I know you said you wanted to use the built in stuff but AD Manager Plus does some good reports, quick and easy to install with fully functional 30 day trial.

 

I always liked that program but never got it, when my trial ran out I'd done all I needed to.

Posted
To get it working you need to raise the domain functional level to Windows 2003 native. Then wait a period of time for the attributes to actually mean anything.
Posted

Either way, that won't make dsrm work.. you just need to add the -noprompt switch to get it to accept input from STDIN properly:

 

dsquery computer -stalepwd 180 | dsrm -noprompt

 

(also your pipe character wasn't the same as mine, but I'm not sure if that's the forum mangling it)

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...