nameless

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • Avatar
    nameless
    Member

    Thanks!
    The thing is, right now, its just theoretical study. No practice or anything so the version isn’t really important i guess

    Avatar
    nameless
    Member

    Im very sorry i postedit in the wrong place!!

    Avatar
    nameless
    Member
    in reply to: Can i create DCHP Superscope for my problem? #325518

    Re: Can i create DCHP Superscope for my problem?

    Killerbe;104346 wrote:
    it is unclear why you want to achieve this.
    Are you running out of Ip’s within your scope?
    Or do you want to create two seperate networks (which i think note, as you want to superscope). Why don’t create a new scope in a larger class segment?
    Example:

    Use A class10.X.X.X and subnetting.

    i want to create 2 seperate networks. .2 network and .5 network. The purpose is security reasons thanks

    Avatar
    nameless
    Member
    in reply to: Logon Disable Policy #325517

    Re: Logon Disable Policy

    deadite;101695 wrote:
    Here you go… this is set to run on an entire Domain and will disable any account that has not logged on in over 90 days. Please note, you need to set the ADVersion depending on your AD Level (2003 or 2000)

    ‘ DisableOldAccounts.vbs
    Option Explicit
    On error Resume Next

    Const ADS_SCOPE_SUBTREE = 2

    Dim objRootDSE
    Dim objConnection, objCommand, objRecordSet
    Dim UserDN, objUser, strDNSDomain, strQuery
    Dim objLogon, strWeeks, strDays, intLogonTime
    Dim intLLTS, intReqCompare, ADVersion

    ‘ADVersion = “2003”
    ADVersion = “2000”

    ‘ Determine DNS domain name from RootDSE object.
    Set objRootDSE = GetObject(“LDAP://RootDSE”)
    strDNSDomain = objRootDSE.Get(“defaultNamingContext”)

    ‘ Use ADO to search Active Directory for all Users.
    Set objConnection = CreateObject(“ADODB.Connection”)
    Set objCommand = CreateObject(“ADODB.Command”)
    objConnection.Provider = “ADsDSOObject”
    objConnection.Open “Active Directory Provider”
    Set objCommand.ActiveConnection = objConnection

    objCommand.Properties(“Page Size”) = 1000
    objCommand.Properties(“Searchscope”) = ADS_SCOPE_SUBTREE

    strQuery = “SELECT distinguishedName FROM ‘LDAP://” & strDNSDomain & “‘ WHERE objectCategory = ‘User'”

    objCommand.CommandText = strQuery
    Set objRecordSet = objCommand.Execute

    objRecordSet.MoveFirst
    Do Until objRecordSet.EOF
    UserDN = objRecordSet.Fields(“distinguishedName”).Value
    Set objUser = GetObject(“LDAP://” & UserDN)

    ‘ Begin calculation
    If ADVersion = “2003” Then
    set objLogon = objUser.Get(“lastLogonTimeStamp”)
    Else
    set objLogon = objUser.Get(“lastLogon”)
    End If
    intLogonTime = objLogon.HighPart * (2^32) + objLogon.LowPart
    intLogonTime = intLogonTime / (60 * 10000000)
    intLogonTime = intLogonTime / 1440
    intLLTS = intLogonTime + #1/1/1601#
    If DateDiff(“d”,intLLTS,Date) > 90 Then
    ‘ Check if Account is Enabled
    If objUser.AccountDisabled = FALSE Then
    ‘ Disable Account
    objUser.AccountDisabled = TRUE
    objUser.SetInfo
    End If
    wscript.echo Mid(objUser.Name,4) & “,Disabled,last logged on at ” & intLLTS
    End If

    objRecordSet.MoveNext
    Loop

    Wscript.Echo “Finished”

    may i know how can i install this code at window server 2003?

Viewing 4 posts - 1 through 4 (of 4 total)