Link to home
Create AccountLog in
Avatar of Kenneth Vandbaek
Kenneth VandbaekFlag for Denmark

asked on

How to find computers in AD that has not login?

Some time our user don't shutdown the copmuter they work with.

How is it possible for me to find these computers that hasen't been rebooted?

Best regards
Avatar of SISAnt
SISAnt

I'm not quite sure that you can find specific uptimes of computers across your domain.

But as a possible resolution for you, you CAN set computers to shutdown automatically at certain times using the windows Task scheduler and putting the new task as windows\system32\shutdown.exe

this might also be applied by GPO

Obviously I can appreciate that this might not work so well in an environment where you have 24/7 workers.
oh. just one point to note.. shutdown.exe doesn't work on its own. you'll need to add -s ("shutdown.exe -s") which will do the shutdown.
Microsoft provides a tool, UPTIME, that you can use to determine exactly how long any one computer has been running for.
http://support.microsoft.com/kb/232243

If you want to query AD directly, you can use ADFIND
(http://joeware.net/freetools/tools/adfind/index.htm)

The syntax would be something like (you'll have to play with it a bit, especially the time format)
a -f "&(objectcategory=computer)(lastlogontimestamp>=03/24/2011-10:30:26)" -dn
thanks Chev, thats a useful little tool.
Avatar of Kenneth Vandbaek

ASKER

We have in our company different logonserver. We have a longonserver for each site in every countries we do business in. The computer and user information on each server is different, well it takes time before everyone is up todate.

Is it possible with the last tool, to change the logonsever?
Hi,

if you are on windows server2008 i can write to ps code that can find uptime and then also shutdown the systems based on criteria supplied
ASKER CERTIFIED SOLUTION
Avatar of Chev_PCN
Chev_PCN
Flag of South Africa image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer