ROKUS.net - Home
 Home    sdcarroll*gmail   

  Testing...

· Today on AFN-K

Ha Ha
Click for Ewa Beach, Hawaii Forecast

  Main Menu
· TrackBack Tool


  Topics
· Blogs
· Dell Servers
· Korea
· Microsoft - Servers
· Microsoft - Exchange
· Misc
· Security
· XML

· · ·All Articles· · ·

  Voice Over IP

Please click

  Last 10 Articles...
· Reading this post will save you ten bucks...
· National Treasure (2004)
· Become your own webhost.
· Mok-dong (Seoul) Immigration Office Hours
· Need to publish confidential documents? Microsoft Redaction tool may be for you!
· RSS and XML: Seoul Computer Club Presentation.
· Operations Guides
· Cool Optical Illusions
· Microsoft releases SNARF - an email relationship tool
· Link Dump / Exchange

  Search this site
Google

ROKUS.NET


This blog is no longer updated.

Since I own the domain name for a couple more years, and the hosting was paid-in-advance, it's still here. But I've moved on to Hawaii, and no longer have the need to publish all the sorts of neat stuff that made up the contents of this website.

If you've linked to me, you are invited to unlink, as your readers will no longer be presented with new content. Thanks, Steve
Old Computer Accounts
Wednesday, June 22, 2005 : Stephen D. Carroll, rokus.net

To find old computers in your AD domain, you can use an LDAP filter in Active Directory Users and Computers (ADUC):

Select View, Filter Options..., and select Create custom filter, then click Customize... On the Advanced tab enter an LDAP query like:

&nbsp;&nbsp;&nbsp;(&(objectCategory=computer)(pwdLastSet<=127520532000000000))

"127520532000000000" corresponds to 2/5/2005. To use a different date as the filter, there's a script below the "read more" text below that will convert your date to an integer.

Via microsoft.public.windows.server.active_directory newsgroup, Richard Mueller, www.rlmeuller.net
' DateToInteger8.vbs
' VBScript program demonstrating how to convert a datetime value to
' the corresponding Integer8 (64-bit) value. The Integer8 value is the
' number of 100-nanosecond intervals since 12:00 AM January 1, 1601,
' in Coordinated Universal Time (UTC). The conversion is only accurate
' to the nearest second, so the Integer8 value will always end in at
' least 7 zeros.
'
' ----------------------------------------------------------------------
' Copyright (c) 2004 Richard L. Mueller
' Hilltop Lab web site - http://www.rlmueller.net
' Version 1.0 - June 11, 2004
'
' You have a royalty-free right to use, modify, reproduce, and
' distribute this script file in any way you find useful, provided that
' you agree that the copyright owner above has no warranty, obligations,
' or liability for such use.

Option Explicit

Dim dtmDateValue, dtmAdjusted, lngSeconds, str64Bit
Dim objShell, lngBiasKey, lngBias, k

If Wscript.Arguments.Count <> 1 Then
  Wscript.Echo "Required argument <DateTime> missing"
  Wscript.Echo "For example:"
  Wscript.Echo ""
  Wscript.Echo "cscript DateToInteger8.vbs ""2/5/2004 4:58:58 PM"""
  Wscript.Echo ""
  Wscript.Echo "If the date/time value has spaces, enclose in quotes"
  Wscript.Quit
End If

dtmDateValue = CDate(Wscript.Arguments(0))

' Obtain local Time Zone bias from machine registry.
Set objShell = CreateObject("Wscript.Shell")
lngBiasKey = objShell.RegRead("HKLM\System\CurrentControlSet\Control\" _
  & "TimeZoneInformation\ActiveTimeBias")
If UCase(TypeName(lngBiasKey)) = "LONG" Then
  lngBias = lngBiasKey
ElseIf UCase(TypeName(lngBiasKey)) = "VARIANT()" Then
  lngBias = 0
  For k = 0 To UBound(lngBiasKey)
    lngBias = lngBias + (lngBiasKey(k) * 256^k)
  Next
End If

' Convert datetime value to UTC.
dtmAdjusted = DateAdd("n", lngBias, dtmDateValue)

' Find number of seconds since 1/1/1601.
lngSeconds = DateDiff("s", #1/1/1601#, dtmAdjusted)

' Convert the number of seconds to a string
' and convert to 100-nanosecond intervals.
str64Bit = CStr(lngSeconds) & "0000000"
Wscript.Echo "Integer8 value: " & str64Bit










Permalink |   Mail this...

Old Computer Accounts | Login/Create an account | 0 Comments
Comments are owned by the poster. We aren't responsible for their content.




  Help Desk Manager    

Logos not available:
Dell Certified Storage Network Professional
Snort Certified Professional



Standard disclaimers apply: This website contains the personal opinions of the author,
and is neither endorsed nor sponsored by the United States government, its agencies,
nor anyone else, to include my employer, my coworkers, my friends, or anyone
that I haven't yet met. If you nonconcur with what's included on this site, either
(a) leave a comment, send me an email, or tell me if you see me (e.g. "feedback") or (b) don't.

These guys make me look good: