List of computers not logged into in more than four weeks

dsquery computer -name COMPUTERNAME -inactive 4

1
2014-01-02 20:29:04

These Might Interest You

  • This is longer than others on here. The reason for this is I have combined two different matrix commands so it would work on all computers. I logged onto my server through a computer and it worked fine. I logged into my server through a mac and it looked $4!t so I have made one that works through both. Show Sample Output


    -1
    echo -e "CHECK=SAMPLE" output --command_to_long
    techie · 2013-04-03 08:46:47 1
  • Good for automating reports that need to run from between two dates. Show Sample Output


    15
    date -d '2 weeks ago Saturday' +%Y-%m-%d
    NPH · 2009-02-21 16:42:52 2
  • What *have* I been working on for the last 2 weeks... Show Sample Output


    0
    find . -type f -mtime -14 -exec ls -ltd \{\} \; | less
    eludom · 2010-05-27 14:54:23 2
  • Using the gcalcli interface to google calendar, print the calendar for the next 2 weeks according to the width of the terminal being used. * Remove "--mon" to start week on sunday, * Change 2 for more or less weeks gcalcli --mon --width $((COLUMNS/8)) calm for whole month Show Sample Output


    0
    gcalcli --mon --width $((COLUMNS/8)) calw 2
    jaw42 · 2013-07-04 12:28:51 0

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: