KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

AD computer cleanup - could use work

 
Post new topic   Reply to topic    KiXforms Forum Index -> Script Archive
View previous topic :: View next topic  
Author Message
maciep
KiXforms Regular
KiXforms Regular


Joined: 01 May 2003
Posts: 43
Location: Pittsburgh,PA

PostPosted: Thu Sep 09, 2004 6:20 pm    Post subject: AD computer cleanup - could use work Reply with quote

Hi all,

I wrote this little form to cleanup old computer accounts in active directory. It uses the password age property of computer objects to determine if it is indeed an old machine. it's based off of this vbscript http://www.rlmueller.net/Programs/MoveOldComputers.txt

The date calcs were a little tough to convert but i used some of those fantastic public udfs. Still not sure if it's 100% accurate, but it is good enough for me.

But when it comes to creating forms, i'm very lazy. I find it to be a mundane process. So there is no color, style,docking etc in this form. and the script itself will probably not be considered to be up to most scripters' standards.

But i thought i'd post it here anyway in case anyone would like to improve on it. personally, i'm done with it. it serves the purpose i need it to.
Back to top
View user's profile Send private message
maciep
KiXforms Regular
KiXforms Regular


Joined: 01 May 2003
Posts: 43
Location: Pittsburgh,PA

PostPosted: Thu Sep 09, 2004 6:22 pm    Post subject: Reply with quote

Code:

break on

;----------------------------------------------
; Initialize ADO connections for AD
;----------------------------------------------
$objConnection = CreateObject("ADODB.Connection")
$objConnection.Open("Provider=ADsDSOObject;")
$objCommand = CreateObject("ADODB.Command")
$objCommand.ActiveConnection = $objConnection

$objCommand.Properties("Page Size").Value = 100
$objCommand.Properties("Cache Results").Value = (not 1)

$logFile= @scriptdir + "\results.csv"
$excelPath = readvalue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\excel.exe", "Path") + "excel.exe"

;**********************************************
; Create System object
;**********************************************
$Sys = createobject("Kixtart.System")

;**********************************************
; Form2: Used to select a container where old
; accounts can't be moved to
;**********************************************
; Create the Form
$Form2 = $Sys.Form
$Form2.Size = 400,500
$Form2.Visible = not 1
$Form2.Text = "Container to move old machines to"

; Create the AD GroupBox
$grpAD2 = $Form2.Controls.GroupBox()
$grpAD2.Location = 15,15
$grpAD2.Size = 350,350
$grpAD2.Text = "Select a container"

; Create the AD TreeView
$trvAD2 = $grpAD2.Controls.TreeView()
$trvAD2.Size = 300,300
$trvAD2.Location = 15,15
$trvAD2.OnBeforeExpand = "OnBeforeExpand2()"

; Ok Button
$btnOK = $Form2.Controls.Button
$btnOK.Location = 100,400
$btnOK.Text = "OK"
$btnOK.OnClick = "$$txtMoveOU.Text = $$trvAD2.SelectedNode.Tag" +
                 "$$Form2.Hide"
; Initialize the treeview
InitAD2()

;**********************************************
; The main form. 
;**********************************************
; Create the form
$Form = $Sys.Form
$Form.Size = 600,600
$Form.Visible = (not 0)
$Form.Text = "AD Cleanup"

;----------------------------------------------
; AD GroubBox
;----------------------------------------------
$grpAD = $Form.Controls.GroupBox()
$grpAD.Location = 15,15
$grpAD.Size = 350,350
$grpAD.Text = "Select a container"

; AD treeview
$trvAD = $grpAD.Controls.TreeView()
$trvAD.Size = 300,300
$trvAD.Location = 15,15
$trvAD.OnBeforeExpand = "OnBeforeExpand()"

;----------------------------------------------
; Search depth groupbox
;----------------------------------------------
$grpDepth = $Form.Controls.GroupBox()
$grpDepth.Location = 400,15
$grpDepth.Size = 150,80
$grpDepth.Text = "Search Depth"

; Subtree radio button
$rbSubtree = $grpDepth.Controls.RadioButton
$rbSubtree.Location = 15,15
$rbSubtree.Text = "Subtree"
$rbSubtree.Checked = not 0

; One Level radio button
$rbOneLevel = $grpDepth.Controls.RadioButton
$rbOneLevel.Location = 15,45
$rbOneLevel.Text = "One Level"

;----------------------------------------------
; Account properties group box
;----------------------------------------------
$grpProps = $Form.Controls.GroupBox()
$grpProps.Location = 400,125
$grpProps.Size = 150,240
$grpProps.Text = "Account Properties"

; Days old label
$labDaysOld = $grpProps.Controls.Label
$labDaysOld.Location = 15,20
$labDaysOld.Height = 40
$labDaysOld.Text = "Search for accounts older than"

; Days old spin control
$spnDaysOld = $grpProps.Controls.SpinButton
$spnDaysOld.Location = 15,60
$spnDaysOld.Height = 25
$spnDaysOld.Minimum = 30
$spnDaysOld.Maximum = 1000
$spnDaysOld.Value = 30
$spnDaysOld.OnChange = "$$txtDaysOld.Text = cstr($$spnDaysOld.Value) + ' days'"

; Days old text box
$txtDaysOld = $grpProps.Controls.TextBox
$txtDaysOld.Location = 60, 62
$txtDaysOld.Size =  75,20
$txtDaysOld.ReadOnly = not 0
$txtDaysOld.Text = cstr($spnDaysOld.Value) + ' days'

; Checkbox to disable computers
$cbDisable = $grpProps.Controls.CheckBox
$cbDisable.Location = 15, 100
$cbDisable.Text = "Disable old accounts"
$cbDisable.Checked = not 1
$cbDisable.OnClick = "ToggleGrpUser(($$cbMove.Checked or $$cbDisable.Checked))"

; Checkbox to move computers
$cbMove = $grpProps.Controls.CheckBox
$cbMove.Location = 15, 145
$cbMove.Text = "Move old accounts"
$cbMove.Checked = not 1
$cbMove.OnClick = "$$txtMoveOU.Enabled = iif($$cbMove.Checked,not 0, not 1) " +
                  "$$btnMoveOU.Enabled = $$txtMoveOU.Enabled " +
                  "ToggleGrpUser(($$cbMove.Checked or $$cbDisable.Checked))"
               
; Textbox to hold selected OU
; from form2
$txtMoveOU = $grpProps.Controls.TextBox
$txtMoveOU.Location = 15, 180
$txtMoveOU.Size = 85,20
$txtMoveOU.ReadOnly = not 0
$txtMoveOU.Enabled = not 1
$txtMoveOU.OnTextChanged = "$$txtMoveOU.ToolTipText = $$txtMoveOU.Text" +
                           "$$btnMoveOU.ToolTipText = $$txtMoveOU.Text"

; Button to launch form2
$btnMoveOU = $grpProps.Controls.Button
$btnMoveOU.Location = 110,180
$btnMoveOU.Size = 30,20
$btnMoveOU.Text = "..."
$btnMoveOU.Enabled = not 1
$btnMoveOU.OnClick = "ChooseOU()"

;----------------------------------------------
; Credentials GroupBox
;----------------------------------------------
$grpUser = $Form.Controls.GroupBox
$grpUser.Location = 15,375
$grpUser.Size = 350,150
$grpUser.Text = "Authentication for Move and Disable"
$grpUser.Enabled = not 1

; Radio button for current user
$rbCurrentUser = $grpUser.Controls.RadioButton
$rbCurrentUser.Location = 15,15
$rbCurrentUser.Text = "Current user"
$rbCurrentUser.Checked = not 0
$rbCurrentUser.OnClick = "$$txtUserName.Enabled = not 1" +
                       "$$txtPassword.Enabled = not 1"

;radio button for different user
$rbOtherUser = $grpUser.Controls.RadioButton
$rbOtherUser.Location = 15,50
$rbOtherUser.Width = 150
$rbOtherUser.Text = "The following user"
$rbOtherUser.OnClick = "$$txtUserName.Enabled = not 0" +
                       "$$txtPassword.Enabled = not 0"

; label for username
$labUserName = $grpUser.Controls.Label
$labUserName.Location = 40,85
$labUserName.Size = 60,20
$labUserName.Text = "User:"

; text box for username
$txtUserName = $grpUser.Controls.TextBox
$txtUserName.Location = 125,80
$txtUserName.Size = 150,20

; label for password
$labPassword = $grpUser.Controls.Label
$labPassword.Location = 40,120
$labPassword.Size = 60,20
$labPassword.Text = "Password:"

; text box for password
$txtPassword = $grpUser.Controls.TextBox
$txtPassword.Location = 125,115
$txtPassword.Size = 150,20
$txtPassword.PasswordChar = "*"

; Progress Label
$labProgress = $Form.Controls.Label
$labProgress.Location = 400,425
$labProgress.Width = 350
$labProgress.Text = "Status: "

; Progress Bar
$pbProgress = $Form.Controls.ProgressBar
$pbProgress.Location = 400,450
$pbProgress.Size = 150,20
$pbProgress.Step = 1
$pbProgress.Minimum = 0

;----------------------------------------------
; Button to start search
;----------------------------------------------
$btnSearch = $Form.Controls.Button
$btnSearch.Location = 400,500
$btnSearch.Size = 50,25
$btnSearch.Text = "Search"
$btnSearch.OnClick = "Search()"

;----------------------------------------------
; Button to cancel search
;----------------------------------------------
$btnCancel = $Form.Controls.Button
$btnCancel.Location = 475,500
$btnCancel.Size = 50,25
$btnCancel.Text = "Cancel"
$btnCancel.OnClick = "$$Form.Hide $$Form2.Hide"

;----------------------------------------------
; Initialize AD tree
;----------------------------------------------
ToggleGrpUser(0)
InitAD()

;----------------------------------------------
; Start the form
;----------------------------------------------
While $Form.Visible
 $=Execute($Form.DoEvents)
Loop
Exit 1


;************************* Functions **************************

function InitAD()
   dim $rootDSE,$strDomain,$p, $t
   $rootDSE = getobject("LDAP://RootDSE")
   $strDomain = $rootDSE.Get("defaultNamingContext")
   $p = $trvAD.Nodes.Add(join(split(join(split($strDomain,"DC="),""), ","),"."))
   $p.Tag = $strDomain
   $t = $p.Nodes.Add("")
endfunction

;-------------------------------------------------------------

function OnBeforeExpand()
   dim $path, $filter, $root
   dim $cont, $t, $b
   if $trvAD.EventNode.Nodes.Count = 1
      if $trvAD.EventNode.Nodes(0).Text = ""
         $Form.Cursor = 11
         $trvAD.EventNode.Nodes.Remove($trvAD.EventNode.Nodes(0))
         $path = $trvAD.EventNode.Tag
         $filter = "Container", "OrganizationalUnit"
         $root = getobject("LDAP://" + $path)
         $root.Filter = $filter
         for each $cont in $root
            $t = $trvAD.EventNode.Nodes.Add(split($cont.Name,"=")[1])
            $t.Tag = $cont.distinguishedName
            $b = $t.Nodes.Add("")
         next
        $Form.Cursor = 1
     endif
   endif
   $trvAD.EventNode.Expand()
endfunction

;-------------------------------------------------------------

function ToggleGrpUser($bEnable)
   $grpUser.Enabled = $bEnable
   $rbCurrentUser.Enabled = $bEnable
   $rbOtherUser.Enabled = $bEnable
   $txtUserName.Enabled = ($bEnable and $rbOtherUser.Checked)
   $txtPassword.Enabled = ($bEnable and $rbOtherUser.Checked)
endfunction

;-------------------------------------------------------------

function Search()
   dim $path, $objRecordSet,$logEntry
   dim $curComputer,$dn,$curAge
   dim $daysOld,$err,$dtmPwdLastSet
   dim $totCount,$moveCount,$disCount,$oldCount
   dim $objLDAP, $objComputer
   
   if not ValidateForm()
      return
   endif

   $totCount = 0
   $moveCount = 0
   $disCount = 0

   if exist($logFile)
      del $logFile
   endif
   $ = open(1, $logFile,5)

   $ = writeline(1, "Computer Name,Password Age,Move,Error Code,Disable,Error Code" + @crlf)
   $objLDAP = getobject("LDAP:")
   
   $objCommand.CommandText = "SELECT Name,pwdLastSet,distinguishedName FROM 'LDAP://" + $trvAD.SelectedNode.Tag +
                              "' WHERE objectCategory='computer'"
   $objCommand.Properties("SearchScope").Value = iif($rbSubtree.Checked,2,1)

   $labProgress.Text = "Status: Searching for machines"
   $objRecordSet = $objCommand.Execute()
   
   $pbProgress.Value = $pbProgress.Minimum
   $pbProgress.Maximum = $objRecordSet.RecordCount
   $labProgress.Text = "Status: " + $pbProgress.Maximum + " machines found"
   sleep 2
   
   $objRecordSet = $objCommand.Execute()
   $objRecordSet.MoveFirst()
   while not $objRecordSet.EOF
      $curComputer = $objRecordSet.Fields("Name").Value
      $dn = $objRecordSet.Fields("distinguishedName").Value
      $curAge = $objRecordSet.Fields("pwdLastSet").Value
      $dtmPwdLastSet = Integer8Date($curAge, $lngBias)
      $daysOld = datecalc(@date,$dtmPwdLastSet)
      $logEntry = $curComputer + "," + $daysOld
      $labProgress.Text = "Status: Checking " + $curComputer
      if $daysOld > $spnDaysOld.Value
         $oldCount = $oldCount + 1
         if $cbMove.Checked
            $labProgress.Text = "Status: Moving " + $curComputer
            if $txtUserName.Enabled
               $objOU = $objLDAP.OpenDSObject("LDAP://" + $txtMoveOU.Text,$txtUserName.Text,$txtPassword.Text,1)
            else
               $objOU = getobject("LDAP://" + $txtMoveOU.Text)
            endif
            $objComputer = $objOU.MoveHere("LDAP://" + $dn, "cn=" +$curComputer)
            $err = @error
            if not $err
               $moveCount = $moveCount + 1
            endif
            $logEntry = $logEntry + ",Yes," + $err
         else
            $logEntry = $logEntry + ",,"
            if $txtUserName.Enabled
               $objComputer = $objLDAP.OpenDSObject("LDAP://" + $dn,$txtUserName.Text,$txtPassword.Text,1)
            else
               $objComputer = getobject("LDAP://" + $dn)
            endif
         endif

         if $cbDisable.Checked
            $labProgress.Text = "Status:  Disabling " + $curComputer
            $objComputer.AccountDisabled = not 0
            $ = $objComputer.SetInfo()
            $err = @error
            if not $err
               $disCount = $disCount + 1
            endif
            $logEntry = $logEntry + ",Yes," + $err
         endif
      endif
     
      $totCount = $totCount + 1
      $ = writeline(1, $logEntry + @crlf)
      $pbProgress.PerformStep()
      $objRecordSet.MoveNext
      sleep 0.05
   Loop
   
   $labProgress.Text = "Status: "
   $pbProgress.Value = 0
   $ = close(1)
   
   $message =  "" + $totCount + " total machines found" + @crlf + @crlf +
               $oldCount + " machines older than " + $spnDaysOld.Value + " days" +  @crlf + @crlf +
               $moveCount + " machines moved" + @crlf + @crlf +
               $disCount + " machines disabled" + @crlf + @crlf +@crlf +
               "View results log?"
   if $Sys.MessageBox.Show($message,"Results",4) = 6
      if not exist($excelPath)
         $ = $Sys.MessageBox.show("Cannot find excel.exe")
      else
         run $excelPath + " " + $logFile
      endif
   endif
endfunction

;-------------------------------------------------------------

function ValidateForm()
   $ValidateForm = 0
   if not $trvAD.SelectedNode
      $ = $Sys.MessageBox.Show("Please select a container.")
      return
   endif
   
   if $cbMove.Checked
      if $txtMoveOU.Text = ""
         $ = $Sys.MessageBox.Show("Please select a container for the move")
         $btnMoveOU.SetFocus()
         return
      endif
   endif

   if $txtUserName.Enabled
      if not $txtUserName.Text
         $ = $Sys.MessageBox.Show("Please enter a username")
         $txtUserName.SetFocus()
         return
      endif

      if not $txtPassword.Text
         $ = $Sys.MessageBox.Show("Please enter a password")
         $txtPassword.SetFocus()
         return
      endif
   endif
   $ValidateForm = 1
endfunction

;-------------------------------------------------------------

Function Integer8Date($objDate, $lngBias)
  Dim $lngAdjust, $lngDate, $lngHigh, $lngLow
  $lngAdjust = $lngBias
  $lngHigh = $objDate.HighPart
  $lngLow = $objDate.LowPart
  If ($lngHigh = 0) And ($lngLow = 0)
    $lngAdjust = 0
  EndIf
  $lngDate = ((cdbl($lngHigh) * $Sys.Math.pow(2,32) + $lngLow) / 600000000 - $lngAdjust) / 1440
  $Integer8Date =DateCalc("1601/01/01",cint($lngDate))
EndFunction

;-------------------------------------------------------------

function DateCalc($date1, $DateOrMod, optional $SingleDigit)
    dim $_intDate1, $_intYear1, $_intMonth1, $_intDay1
    dim $_intDate2, $_intYear2, $_intMonth2, $_intDay2
    $date1 = split($date1,'/')
    if ubound($date1) <> 2
        exit 1
    endif

    $_intYear1  = val($date1[0])
    $_intMonth1 = val($date1[1])
    $_intDay1   = val($date1[2])
    if $_intMonth1 < 3
        $_intMonth1 = $_intMonth1 + 12
        $_intYear1  = $_intYear1  - 1
    endif
    $_intDate1 = $_intDay1 + ( 153 * $_intMonth1 - 457 ) / 5 + 365 * $_intYear1 +
                 $_intYear1 / 4 - $_intYear1 / 100 + $_intYear1 / 400 - 306
    select
        case vartype($DateOrMod) = 3
            $_intDate2  = $_intDate1 + $DateOrMod
            if instr($_intDate2,'-') $_intDate2 = val(substr($_intDate2,2,len($_intDate2)-1)) endif

            $_intYear2  = ( 100 * ( ( ( 100*($_intDate2+306)-25)/3652425)
                                     - ( ((100*($_intDate2+306)-25)/3652425)/4)
                                   ) + (100*($_intDate2+306)-25)
                           ) / 36525
            $_intMonth2 = (   5 * ( ( ( 100*($_intDate2+306)-25)/3652425)
                                     - ( ((100*($_intDate2+306)-25)/3652425)/4)
                                     + ($_intDate2+306) - 365 * $_intYear2 - $_intYear2 / 4
                                   ) + 456
                           ) / 153
            $_intDay2   = ( ( ( 100*($_intDate2+306)-25)/3652425)
                                     - ( ((100*($_intDate2+306)-25)/3652425)/4)
                                     + ($_intDate2+306) - 365 * $_intYear2 - $_intYear2 / 4
                           )         - ( 153 * $_intMonth2 - 457
                                        ) / 5
            if $_intMonth2 > 12 $_intYear2 = $_intYear2 + 1 $_intMonth2 = $_intMonth2 - 12 endif
            if not $SingleDigit
                if len($_intYear2 ) < 4
                    $_ = execute("for $i=1 to 4-len($$_intYear2) $$_intYear2 = '0' + $$_intYear2 next")
                endif
                $_intMonth2 = right("0" + $_intMonth2,2)
                $_intDay2   = right("0" + $_intDay2,2)
            endif
            $DateCalc = '$_intYear2/$_intMonth2/$_intDay2'
        case vartype($DateOrMod) = 8
            $DateOrMod = split($DateOrMod,'/')
            if ubound($DateOrMod) <> 2
                exit 1
            endif
            $_intYear2  = val($DateOrMod[0])
            $_intMonth2 = val($DateOrMod[1])
            $_intDay2   = val($DateOrMod[2])
            if $_intMonth2 < 3
                $_intMonth2 = $_intMonth2 + 12
                $_intYear2  = $_intYear2  - 1
            endif
            $_intDate2 = $_intDay2 + ( 153 * $_intMonth2 - 457 ) / 5 + 365 * $_intYear2 +
                         $_intYear2 / 4 - $_intYear2 / 100 + $_intYear2 / 400 - 306
            $DateCalc  = $_intDate1 - $_intDate2
            ;comment the next line if you wish to return negative results also !!!
            if instr($DateCalc,'-') $DateCalc = val(substr($DateCalc,2,len($DateCalc)-1)) endif
        case 1
            exit 1
    endselect
endfunction

;-------------------------------------------------------------

Function fnSecondsToHMMSS($lSeconds)
   If Not VarType($lSeconds)=3 $fnSecondsToHMMSS="Invalid VarType" Exit(1) EndIf
   If $lSeconds < 0 $fnSecondsToHMMSS="Error" Exit(1) EndIf
   Select
      Case $lSeconds<60
         If $lSeconds<10 $lSeconds="0"+$lSeconds EndIf
         $fnSecondsToHMMSS="0:00:"+$lSeconds
      Case $lSeconds<3600
         $lMinutes=$lSeconds/60
         $lSeconds=$lSeconds-$lMinutes*60
         If $lMinutes<10 $lMinutes="0"+$lMinutes EndIf
         If $lSeconds<10 $lSeconds="0"+$lSeconds EndIf
         $fnSecondsToHMMSS="0:"+$lMinutes+":"+$lSeconds
      Case 1
         $lHours=$lSeconds/3600
         $lSeconds=$lSeconds-$lHours*3600
         $lMinutes=$lSeconds/60
         $lSeconds=$lSeconds-$lMinutes*60
         If $lMinutes<10 $lMinutes="0"+$lMinutes EndIf
         If $lSeconds<10 $lSeconds="0"+$lSeconds EndIf
         $fnSecondsToHMMSS=""+$lHours+":"+$lMinutes+":"+$lSeconds
   EndSelect
   Exit(0)
EndFunction

;-------------------------------------------------------------

function ChooseOU()
   $Form2.Show()
   While $Form.Visible
      $=Execute($Form.DoEvents)
   Loop
endfunction

;-------------------------------------------------------------

function InitAD2()
   dim $rootDSE,$strDomain,$p, $t
   $rootDSE = getobject("LDAP://RootDSE")
   $strDomain = $rootDSE.Get("defaultNamingContext")
   $p = $trvAD2.Nodes.Add(join(split(join(split($strDomain,"DC="),""), ","),"."))
   $p.Tag = $strDomain
   $t = $p.Nodes.Add("")
endfunction

;-------------------------------------------------------------

function OnBeforeExpand2()
   dim $path, $filter, $root
   dim $cont, $t, $b
   if $trvAD2.EventNode.Nodes.Count = 1
      if $trvAD2.EventNode.Nodes(0).Text = ""
         $Form2.Cursor = 11
         $trvAD2.EventNode.Nodes.Remove($trvAD2.EventNode.Nodes(0))
         $path = $trvAD2.EventNode.Tag
         $filter = "Container", "OrganizationalUnit"
         $root = getobject("LDAP://" + $path)
         $root.Filter = $filter
         for each $cont in $root
            $t = $trvAD2.EventNode.Nodes.Add(split($cont.Name,"=")[1])
            $t.Tag = $cont.distinguishedName
            $b = $t.Nodes.Add("")
         next
        $Form2.Cursor = 1
     endif
   endif
   $trvAD2.EventNode.Expand()
endfunction


Last edited by maciep on Mon Oct 18, 2004 3:29 pm; edited 1 time in total
Back to top
View user's profile Send private message
Jochen
KiXforms Devotee
KiXforms Devotee


Joined: 05 Mar 2003
Posts: 1204
Location: Stuttgart, Germany

PostPosted: Fri Sep 10, 2004 6:22 am    Post subject: Reply with quote

Quote:
The date calcs were a little tough to convert but i used some of those fantastic public udfs. Still not sure if it's 100% accurate, but it is good enough for me.


I see you used DateCalc() for it ... thanx for trusting me Wink (Not really, in fact you trusted Mr. Peter Baum who did those algorithms)
As far as it concerns accuracy, yeah it is, for past it goes further than there were any Computers; Gregorian Calendar conversion was deep in the middle ages. For future dates it seems to be stable until there are any changes to the Calendar System...

_________________
Jochen

Tell me, and I will forget.
Show me, and I may remember.
Involve me, and I will understand.
Back to top
View user's profile Send private message MSN Messenger
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Fri Sep 10, 2004 12:24 pm    Post subject: Reply with quote

Eric, this is extremely well done. Really top-notch work. Would like to get this published to the downloads section if you dont mind.

-Shawn
Back to top
View user's profile Send private message
maciep
KiXforms Regular
KiXforms Regular


Joined: 01 May 2003
Posts: 43
Location: Pittsburgh,PA

PostPosted: Fri Sep 10, 2004 1:03 pm    Post subject: Reply with quote

Jochen, of course of i trust you. honestly if it wasn't for those date/time udfs, i would have never written this form.

Shawn, thanks for the compliment. But i have to say that with your wonder dll, it was a piece of cake. And no i don't mind at all if you publish it to the downloads. Share the wealth, you know.
Back to top
View user's profile Send private message
Xypriz
KiXforms Regular
KiXforms Regular


Joined: 27 Nov 2003
Posts: 34

PostPosted: Tue Oct 12, 2004 1:30 pm    Post subject: Reply with quote

Nice script Very Happy ;

however I wonder how I can make the "User:" and "Password:" label greyed-out just like the groupbox when "The following user" is NOT selected.

I found out that it can be made possible by using textboxes but as soon as I want to use labels it doesn't work. When I select "The following user", "User:" and "Password:" remains grey. When I move-over with my mouse they suddenly become active, and... they remain active, even when I select "Current user" again. It looks like the label object isn't as dynamic as the textbox object. How can this problem be solved?
Back to top
View user's profile Send private message
Xypriz
KiXforms Regular
KiXforms Regular


Joined: 27 Nov 2003
Posts: 34

PostPosted: Tue Oct 12, 2004 4:10 pm    Post subject: Reply with quote

I found out that the "Search Depth"-function doesn't work either... too bad... We are using a Windows 2000 AD. Searching for a solution on this one. Anyone here who can help on both problems?

Maciep's idea for this script is really great and his (already great) script should be worked out to a perfect one.
Back to top
View user's profile Send private message
Xypriz
KiXforms Regular
KiXforms Regular


Joined: 27 Nov 2003
Posts: 34

PostPosted: Mon Oct 18, 2004 12:30 pm    Post subject: Reply with quote

No one? Sad
Back to top
View user's profile Send private message
Les
KiXforms Aficionado
KiXforms Aficionado


Joined: 24 Dec 2003
Posts: 317

PostPosted: Mon Oct 18, 2004 12:50 pm    Post subject: Reply with quote

I think when the author made the disclaimer "could use work", I think he meant YOU should do the work.
_________________
The Repro Man
Stealing for a living!
Back to top
View user's profile Send private message
maciep
KiXforms Regular
KiXforms Regular


Joined: 01 May 2003
Posts: 43
Location: Pittsburgh,PA

PostPosted: Mon Oct 18, 2004 3:28 pm    Post subject: Reply with quote

Indeed that is what i meant. But you are right about the search scope. Try changing "Search Scope" to "SearchScope" in the Search() function and see if that works (i will edit the my original post) And i don't think you can grey out the labels. i think i tried to disable them as well, but it really doesn't accomplish anything.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> Script Archive All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group