Jump to content

Recommended Posts

Posted
hey ppl, I'm trying to create a query to get a list of users inactive for 60 days or users who have not logged on to the network for 60 days. I tried to run dsquery but got an "dsquery failed: the parameter is incorrect. Windows could not run this query because you are connected to a domain that does not support this query". Any help on this is appreciated
Posted (edited)

What's the functional level of your domain/forest? That might be where dsquery is choking.

 

dsquery -inactive 8

 

will give you a list of people who haven't logged in for 8 weeks (56 days)

 

Use the -o option to format the output (samid for example) and the -limit option to set how many to display.

 

dsquery user /? for usage.

 

It's also (iirc) a pre-canned GUI query from AD Users and Computers.

Edited by pete
  • Thanks 1
Posted
I think you can do an advanced search in AD for people who have not logged in for a set period. I then tend to select all remove to a new ou and then wait a few months and then finally delete the accounts.
Posted
functional level of your domain = Windows 2000 native

 

That'll be why - dsquery relies on lastLogonTimeStamp, which needs 2003 native or greater.

Posted
What is my next option as I can't switch domain function levels yet?

 

In Ad open up search - select the Find: drop down menu and select Common Queries. You can then select select days since last logon.

  • Thanks 2
Posted
In Ad open up search - select the Find: drop down menu and select Common Queries. You can then select select days since last logon.

 

I've run dsquery before to disable inactive accounts, but shockingly I didn't know you could do this! So easy, so obvious...... And I see I can do what I wanted to check out - see who has non-expiring passwords!

Posted
I've run dsquery before to disable inactive accounts, but shockingly I didn't know you could do this! So easy, so obvious...... And I see I can do what I wanted to check out - see who has non-expiring passwords!

 

it took me a lot of googling to find that!

Posted
In Ad open up search - select the Find: drop down menu and select Common Queries. You can then select select days since last logon.

 

I'm at that section but I get nothing in results..?? what do I put in the 'Name' and 'Description' box? thanks

Posted
I'm at that section but I get nothing in results..?? what do I put in the 'Name' and 'Description' box? thanks

 

nothing - just make sure you are search whole domain.

Posted
when I search for just 'Disabled accounts' I get results but once I select a 'Days since last logon' the results window is blank..?? could it be my domain function level again?
Posted
when I search for just 'Disabled accounts' I get results but once I select a 'Days since last logon' the results window is blank..?? could it be my domain function level again?

 

not to sure - have you tried the smallest amount of days?

Posted
@techine - Domain Func should not make any diff.

 

Are you sure you're not selecting both disabled and days since last login...

 

yes, our network is all Win2k3 except for two servers which are DC's or I would raise the level to Windows Server 2003

Posted

dont select disable and then try to search using days since last login, try 30 and see what results you get.

 

no need to raise func

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