달력

32024  이전 다음

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

[원본] http://forum.tools4ever.com/viewtopic.php?t=143





Find all Computers that are NT4.0 BDCs
(&(objectCategory=computer)(operatingSystemVersion=4*)(userAccountControl:1.2.840.113556.1.4.803:=8192))

Find all Computers that do not have a Description
(objectCategory=computer)(!description=*)

Find all Groups that have a Description
(objCategory=group)(description=*)

Find all Groups that start with QA or HD
(objectCategory=group)(|(cn=QA*)(cn=HD*))

Find all Objects where Department, Company or Description is Sales
(|(department=Sales)(company=Sales)(description=Sales))

Find all Users created after 01.08.2004
(objectCategory=user)(whenCreated>=20040801000000.0Z)

Find all Users except Sara
(objectCategory=user)(!cn=sara*)

Find all Users that are almost Locked-Out
(objectCategory=user)(badPwdCount>=2)

Find all Users that are Disabled
(&(objectCategory=person)(objectClass=user)(userAccountControl:1.2.840.113556.1.4.803:=2))

Find all Users that are members of QA Users Group in the Help Desk OU in the tools4ever.local domain
(objectCategory=user)(memberOf=CN=QA Users,OU=Help Desk,DC=tools4ever,DC=local)

Find all Users that have an E-Mail Address (not Exchange related)
(objectClass=user)(email=*)

Find all Users that have not changed password since 05.02.2004
(&(objectCategory=person)(objectClass=user)(pwdLastSet>=127204308000000000))
Look below for a .vbs script to convert a date to an integer8 value.

Find all Users that must change password at next logon
(objectCategory=user)(pwdLastSet=0)

Find all Users with Dial-In permissions
(objectCategory=user)(msNPAllowDialin=TRUE)

Find all Users with First Name of David
(objectcategory=user)(cn=David*)

Find all Users with First Name of David or Dana
(objectcategory=user)(|(cn=David*)(cn=Dana*))

Find all Users with Mobile numbers 050 or 051
(objectcategory=user)(|(mobile=050*)(mobile=051*))

Find all Users with Password Never Expires set
(objectcategory=user)(userAccountControl:1.2.840.113556.1.4.803:=65536)

Find all Users, Groups or Contacts where Company or Description is North
(|(objectcategory=user)(objectcategory=group)(objectcategory=contact))(|(description=North*)(company=North*))

Code:
' 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

Posted by tornado
|