ShawnAdministrator
(KiX Supporter)
2002-03-11 06:05 PM
Kixforms: Manage User Details - Here`s MUD in your eye !

Gang,

Well, since nobody thought KiXlander was neat [Wink] here`s a prototype of a new script that allows one to "quicky" Manage User Details (MUD) using Active Directory. Instead of using USRMGR for domains, and having to enumerate all those users and groups into a listbox, this script allows one to perform a single user query, then (in this release) set the password and enable/disable the account.

The reason its a prototype is that it will be using some of the new features of the next release, like setting the PasswordChar on a textbox, etc.

To run this script, you will need a Windows 2K/XP machine, KiXtart 4.0 and the Kixforms Library Build 8, and you can get that from here:

The Kixforms Library

Heres a screenshot:



And heres the script:

code:
Break On 

; REQUIRES:
;
; KIXTART 4.02
; KIXFORMS BUILD 8
; WINDOWS 2K/XP
;

$Form = CreateObject("Kixtart.Form")

$Form.Caption = "Modify User Details - KiXtart"
$Form.ScaleHeight = 506
$Form.ScaleWidth = 600
$Form.FontName = "Arial"
$Form.FontSize = 9
$Form.Center

$fraBanner = $Form.PictureBox
$fraBanner.BackColor = $Form.RGB(255,255,255)
$fraBanner.Height = 137
$fraBanner.Left = 10
$fraBanner.Top = 10
$fraBanner.Width = 585

$fraDetails = $Form.Frame("Details")
$fraDetails.Height = 345
$fraDetails.Left = 8
$fraDetails.Top = 152
$fraDetails.Width = 585

$txtUsername = $fraDetails.TextBox
$txtUsername.Height = 25
$txtUsername.Left = 104
$txtUsername.Top = 24
$txtUsername.Text = ""
$txtUsername.Width = 161

$cmdFindUser = $fraDetails.CommandButton("Find User!")
$cmdFindUser.Default = 1 ; True
$cmdFindUser.FontName = "Comic Sans MS"
$cmdFindUser.FontSize = 12
$cmdFindUser.FontBold = 1
$cmdFindUser.Left = 272
$cmdFindUser.Top = 24
$cmdFindUser.Width = 129
$cmdFindUser.OnClick = "cmdFindUser_Click()"

$txtDisplayName = $fraDetails.TextBox
$txtDisplayName.Height = 25
$txtDisplayName.Left = 104
$txtDisplayName.TabStop = 0 ; False
$txtDisplayName.Top = 56
$txtDisplayName.Width = 297
$txtDisplayName.Enabled = 1
$txtDisplayName.BackColor = $Form.BackColor

$lblDisplayName = $fraDetails.Label("Full Name:")
$lblDisplayName.Width = 75
$lblDisplayName.Left = $txtDisplayName.Left - $lblDisplayName.Width
$lblDisplayName.Top = $txtDisplayName.Top

$txtPassword = $fraDetails.TextBox
$txtPassword.Height = 25
$txtPassword.Left = 104
$txtPassword.PasswordChar = ""
$txtPassword.Top = 88
$txtPassword.Width = 161
$txtPassword.Enabled = 0

$cmdSetPassword = $fraDetails.CommandButton("Set Password!")
$cmdSetPassword.FontName = "Comic Sans MS"
$cmdSetPassword.FontSize = 12
$cmdSetPassword.FontBold = 1
$cmdSetPassword.Left = 272
$cmdSetPassword.Top = 88
$cmdSetPassword.Width = 129
$cmdSetPassword.Enabled = 0
$cmdSetPassword.OnClick = "cmdSetPassword_Click()"

$txtExpiryDate = $fraDetails.TextBox
$txtExpiryDate.Height = 25
$txtExpiryDate.Left = 104
$txtExpiryDate.Top = 120
$txtExpiryDate.Width = 161
$txtExpiryDate.Enabled = 0

$lblPassword = $fraDetails.Label("Password:")
$lblPassword.Width = 75
$lblPassword.Left = $txtPassword.Left - $lblPassword.Width
$lblPassword.Top = $txtPassword.Top

$lblExpiryDate = $fraDetails.Label("Expiry Date:")
$lblExpiryDate.Width = 75
$lblExpiryDate.Left = $txtExpiryDate.Left - $lblExpiryDate.Width
$lblExpiryDate.Top = $txtExpiryDate.Top

$cmdChangeExpiryDate = $fraDetails.CommandButton("Change Date!")
$cmdChangeExpiryDate.FontName = "Comic Sans MS"
$cmdChangeExpiryDate.FontSize = 12
$cmdChangeExpiryDate.FontBold = 1
$cmdChangeExpiryDate.Left = 272
$cmdChangeExpiryDate.Top = 120
$cmdChangeExpiryDate.Width = 129
$cmdChangeExpiryDate.OnClick = "cmdChangeExpiryDate_Click()"
$cmdChangeExpiryDate.Enabled = 0

$lstGroups = $fraDetails.ListBox
$lstGroups.Height = 134
$lstGroups.Left = 104
$lstGroups.Top = 152
$lstGroups.Width = 297
$lstGroups.Enabled = 0

$lblGroups = $fraDetails.Label("Groups:")
$lblGroups.Width = 75
$lblGroups.Left = $lstGroups.Left - $lblGroups.Width
$lblGroups.Top = $lstGroups.Top

$txtBadLoginCount = $fraDetails.TextBox
$txtBadLoginCount.Height = 25
$txtBadLoginCount.Left = 104
$txtBadLoginCount.TabStop = 0 ; False
$txtBadLoginCount.Top = 296
$txtBadLoginCount.Width = 161
$txtBadLoginCount.BackColor = $Form.BackColor

$lblBadLoginCount = $fraDetails.Label("Bad Logins:")
$lblBadLoginCount.Width = 75
$lblBadLoginCount.Left = $txtBadLoginCount.Left - $lblBadLoginCount.Width
$lblBadLoginCount.Top = $txtBadLoginCount.Top

$cmdExit = $fraDetails.CommandButton("Exit!")
$cmdExit.FontName = "Comic Sans MS"
$cmdExit.FontSize = 12
$cmdExit.FontBold = 1
$cmdExit.Top = 296
$cmdExit.Width = 129
$cmdExit.Left = 445
$cmdExit.OnClick = "quit()"

$fraStatus = $fraDetails.Frame
$fraStatus.BackColor = $Form.BackColor
$fraStatus.Caption = "Account Status"
$fraStatus.Height = 105
$fraStatus.Left = 420 ; 416
$fraStatus.Top = 20 ; 224
$fraStatus.Width = 155

$chkAccountDisabled = $fraStatus.CheckBox("Account Disabled")
$chkAccountDisabled.Left = 10
$chkAccountDisabled.TabStop = 0 ; False
$chkAccountDisabled.Top = 24
$chkAccountDisabled.OnClick = "chkAccountDisabled_Click()"
$chkAccountDisabled.Enabled = 0

$chkAccountLocked = $fraStatus.CheckBox("Account Locked")
$chkAccountLocked.Caption = "Account Locked"
$chkAccountLocked.Left = 10
$chkAccountLocked.TabStop = 0 ; False
$chkAccountLocked.Top = 56
$chkAccountLocked.OnClick = "chkAccountLocked_Click()"
$chkAccountLocked.Enabled = 0

$lblUsername = $fraDetails.Label
$lblUsername.Caption = "Username:"
$lblUsername.Height = $txtUsername.Height
$lblUsername.Width = 75
$lblUsername.Left = $txtUsername.Left - $lblUsername.Width
$lblUsername.Top = $txtUsername.Top

; Draw on the banner

$fraBanner.FontSize = 16
$fraBanner.FontName = "verdana"
$fraBanner.FontSize = 28
$fraBanner.ForeColor = $Form.RGB(100,200,200)
$fraBanner.PrintXY(23,10,"Modify User Details")
$fraBanner.ForeColor = 0
$fraBanner.PrintXY(20,7,"Modify User Details")
$fraBanner.FontSize = 12
$fraBanner.ForeColor = $Form.RGB(0,100,100)
$fraBanner.PrintXY(23,58,"Powered by KiXtart v@KIX and Kixforms Build 8")
$fraBanner.FontBold = 1
$fraBanner.PrintXY(23,80,"Welcome @USERID")
$fraBanner.FontBold = 0
$fraBanner.FontSize = 10
$fraBanner.ForeColor = $Form.RGB(0,100,100)

Dim $strUserName
Dim $strUserPath

$txtUsername.SelLength = Len($txtUsername.Text)

$Form.Show
$txtUsername.SetFocus

While $Form.Visible
$=Execute($Form.DoEvents)
Loop

Exit 1

Function cmdFindUser_Click()

Dim $Wait

$Wait = CreateObject("Kixtart.Form")
$Wait.Caption = "One moment please..."
$Wait.ScaleWidth = 500
$Wait.ScaleHeight = 100
$Wait.FontSize = 14
$Wait.FontName = "Arial"
$Wait.PrintXY(30,30,"Searching Active Directory, one moment please...")
$Wait.Center

Dim $adsUser,$adsGroup

If $txtUsername.Text = ""
$= $Form.MsgBox("You must specify a username before clicking Find.", "Username invalid")
$txtUsername.Text = $strUserName
Exit Sub
Else
$strUserName = $txtUsername.Text
Endif

$Wait.Show

$strUserPath = "WinNT://@LDOMAIN/$strUserName,User"

$adsUser = GetObject($strUserPath)

If Not $adsUser

; User does not exist

$= $Form.MsgBox("A user called (" + $txtUsername.Text + ") does not exist.", "Username invalid")

; Disable the controls

$chkAccountDisabled.Enabled = 0
$cmdSetPassword.Enabled = 0
$cmdChangeExpiryDate.Enabled = 0
$txtPassword.Enabled = 0
$cmdChangeExpiryDate.Enabled = 0
$txtPassword.Text = ""
$txtDisplayName.Text = ""
$txtExpiryDate.Text = ""
$txtBadLoginCount.Text = ""
$lstGroups.Clear

Else

$txtPassword.Text = ""
$txtDisplayName.Text = ""
$txtExpiryDate.Text = ""
$txtBadLoginCount.Text = ""
$lstGroups.Clear
$lstGroups.

; User exists so bind to it

$adsUser.GetInfo

$txtDisplayName.Text = $adsUser.FullName
$txtExpiryDate.Text = $adsUser.AccountExpirationDate

If $adsUser.AccountDisabled

; Check the disabled box
$chkAccountDisabled.Value = 1

Else

; Uncheck the disabled box
$chkAccountDisabled.Value = 0

EndIf

If $adsUser.IsAccountLocked

; Check the locked box

$chkAccountLocked.Value = 1

; Enable the checkbox so that the account can be unlocked
$chkAccountLocked.Enabled = True

Else

; Uncheck the locked box
$chkAccountLocked.Value = 0

EndIf

For Each $adsGroup In $adsUser.Groups
$lstGroups.AddItem ($adsGroup.Name)
Next

$strBLC = $adsUser.BadLoginCount
If @ERROR
$txtBadLoginCount.Text = 0
Else
$txtBadLoginCount.Text = $strBLC
EndIf

;Enable the controls

$chkAccountDisabled.Enabled = 1
$cmdSetPassword.Enabled = 1
$cmdChangeExpiryDate.Enabled = 1
$txtPassword.Enabled = 1
$txtExpiryDate.Enabled = 1
$lstGroups.Enabled = 1
$adsUser = 0
$adsGroup = 0
$txtUsername.SetFocus

Endif

$Form.Refresh
$txtUsername.SetFocus

EndFunction

Function chkAccountDisabled_Click()

Dim $adsUser

$adsUser = GetObject($strUserPath)
$adsUser.GetInfo

If $chkAccountDisabled.Value = 0

; Enable account

$adsUser.AccountDisabled = 0
$adsUser.SetInfo
$= $Form.MsgBox("The user (" + $strUserName + ") has been enabled.", "User enabled")

Else

; Disable Account

$adsUser.AccountDisabled = 1
$adsUser.SetInfo
$= $Form.MsgBox("The user (" + $strUserName + ") has been disabled.", "User disabled")

EndIf

$adsUser = 0

EndFunction

Function chkAccountLocked_Click()

Dim $adsUser

If $chkAccountLocked.Value = 0
; Unlock the account
$adsUser = GetObject($strUserPath)
$adsUser.GetInfo
$adsUser.IsAccountLocked = 0
$adsUser.SetInfo
$= $Form.MsgBox("The user (" + $strUserName + ") has been unlocked.", "User enabled")
EndIf

; Disable the checkbox

$chkAccountLocked.Enabled = 0

$adsUser = Nothing

EndFunction

Function cmdSetPassword_Click()

$adsUser = GetObject($strUserPath)
$adsUser.GetInfo

If $txtPassword.Text = ""
$= $Form.MsgBox("The password cannot be empty.", "User password change", 1)
Else
If Len($txtPassword.Text) < 6
$= $Form.MsgBox("The password cannot be less than 6 characters long.", "User password change", 1)
Else
$adsUser.SetPassword($txtPassword.Text)
$= $Form.MsgBox("The password has been changed to (" + $txtPassword.Text + ").", "User password change", 1)
EndIf
EndIf

$txtPassword.Text = ""
$adsUser = Nothing

EndFunction

Function cmdChangeExpiryDate_Click()

Dim $adsUser

$adsUser = GetObject($strUserPath)
$adsUser.GetInfo

If $txtExpiryDate.Text = ""
$= $Form.MsgBox("The expiry date cannot be empty.", "User expiry date change", 1)
$txtExpiryDate.Text = $adsUser.AccountExpirationDate
Else
$adsUser.AccountExpirationDate = $txtExpiryDate.Text
$adsUser.SetInfo
If @ERROR
$= $Form.MsgBox("The expiry date has not been changed due to an error.", "User expiry date change")
Else
$= $Form.MsgBox("The expiry date been changed to (" + $txtExpiryDate.Text + ").", "User expiry date change")
EndIf
EndIf

$adsUser = Nothing

EndFunction

-Shawn

[ 16 March 2002, 15:18: Message edited by: Shawn ]


Alex.H
(Seasoned Scripter)
2002-03-11 07:31 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Hey Shawn, great you came back to Kixforms
Your script remind me of something ... dunno really remember what [Big Grin]
Just kidding, it is really neat. I always like script bringing KiXtart to a such level


ShawnAdministrator
(KiX Supporter)
2002-03-11 07:54 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Hi Alex,

Yeah, this script might seem familar, it was lifted from a book on Active Directory Admin - don`t have the book with me right now and I forget the exact title and author (its an O`Reilly book though) ... got another script Im going to post in a minute or two. Its about 90% original [Wink] ... hope noone thinks im spamming the board here !

-Shawn


NTDOCAdministrator
(KiX Master)
2002-07-12 04:09 AM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Hey... I like this Shawn. I'm gonna have to try and find some time to play around with it.

Thanks for working on this kind of stuff.


MCA
(KiX Supporter)
2002-07-12 04:29 AM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Dear Shawn,

It looks very nice. Without your description on the picture nobody from the past thinks this
can be done with kixtart.
Just with the fundaments from Ruud and the great effort from you and some other guys every-
body can use these great things.

If you like we will put this nice kixtart extension on our site.
Again a great great work.
greetings.

btw: we doesn't saw the picture earlier because we had supress them in the past. A too slow
connection at that time.

[ 12 July 2002, 05:04: Message edited by: MCA ]


LonkeroAdministrator
(KiX Master Guru)
2002-07-12 10:06 AM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

better late than never...

I was wondering why this oldie had popped up on the list, but you guys had found it!

still testing before using is needed as done for build 8.
also, the kixtart release may differ the code functionality.

cheers,


Mark Bennett
(Getting the hang of it)
2002-07-12 11:13 AM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

This is superb! Provides some useful functionality and gives some great examples of code for forms and Active Directory.
Mark


ShawnAdministrator
(KiX Supporter)
2002-07-12 08:48 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Thanks guys.

MCA, I would be most honored if you would host Kixforms off your website. Latest version is Build 20 ... dll,doc,and readme are in zip ... will advise and copy you on any updates as they happen. Thanks again.

-Shawn


MCA
(KiX Supporter)
2002-07-12 08:54 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Thanks Shawn,

We just want to put most used kixtart add-ons on one place. Each to find, but we will never forget
to point to the original URL location.
Possible that next week we get more information about such similar programs after ending the
POLL.
greetings.


MCA
(KiX Supporter)
2002-07-12 11:30 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Shawn,

A suggestion for your package: add those nice examples to it.
Possible interesting ones are:
Where is KiXlander - Game by Shawn
Manage User Details - Here`s MUD in your eye !
KiXtart PiXaso Painter - Unlease Your Artistic Flare - Part II
Poket Poker - Know when to hold 'em
KixMenu - Dynamically build button menus from INI configuration files
KiXtart Messenger - A thin skin for the NET SEND command

The nice related picture are










It our history page will will add above URL links. They are too nice.
greetings.


LonkeroAdministrator
(KiX Master Guru)
2002-07-12 11:33 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

wow, these are flaming now... [Eek!]

MCA
(KiX Supporter)
2002-07-13 01:43 AM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Dear,

Now you can download also Kixforms from our site.
For interesting links about this nice and useful tool see also our History of Site page.
greetings.


Raceeend
(Starting to like KiXtart)
2002-07-17 10:07 AM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Hi Shawn,

Nice usermanager you made it works great.
But i found one error when i ran it.

If an account (NT4.0 domain) is locked out it is not possible to unlock it.

i changed:

$chkAccountLocked.Enabled = True

into

$chkAccountLocked.Enabled = 1

and now it works fine.


ShawnAdministrator
(KiX Supporter)
2002-07-18 02:55 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Eagle-eye Martijn, thanks for spotting (and fixing!) that.

Raceeend
(Starting to like KiXtart)
2002-07-23 03:37 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

no problem [Smile]

Incognito
(Getting the hang of it)
2002-08-02 08:38 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

You should have your utility create the user directory and give an option to make the share at a default user location. (with an option for it to be hidden of course.)

Bonji
(Starting to like KiXtart)
2002-08-16 07:31 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Shawn,

I took this great User Manager script and modified it to allow non-admins to use it effectively (Only change password and unlock account can be manipluated, though the rest can be seen). If you are an administrator (specifically a member of Domain Admins) then all options are opened up to you. I also added some error-checking in case you try to make a change that you are not allowed to: it informs you that the procedure failed. Along with a few cosmetic changes, this is a KiX'n script. The only problem I've seen so far is that Bad Logins never gets reported. It appears to never return a value. Our policy is set to lock accounts after 3 failed attempts. Any feedback would be greatly appreciated.

Also, I'm going to write a rather involved script to manage every aspect of a Windows 2000 domain possible through ADSI (that I need to do). But before I begin I just wanted to inquire if this has been done before. I've done some extensive searching through the board and have found bits and pieces, but nothing comprehensive. Just wondered if anyone was aware of any such script.

BTW, if anyone is curious about this User Manager script, let me know and I'll post it. Just didn't want to post the code if no one is interested.

Thanks,
Ben Dulaney

[ 16. August 2002, 19:39: Message edited by: Ben Dulaney ]


ShawnAdministrator
(KiX Supporter)
2002-08-16 07:49 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Hi Ben, im very excited about this ... yes please, if its not too big post it ... else email me the script at the address in my profile ... im just doing some finishing touches to Kixforms 2.0 and would love to try out your script ... will it run in any environment without change - or is it specific to your domain ?

-Shawn


Waltz
(Seasoned Scripter)
2002-08-16 08:25 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

[Smile]

Ben...

Not only is this a practical app, but also it is very instructive for those of us new to forms design if we can examine how the code is built.

I am anxious to develop a formbased utility kit of some variety for distribution to non-admin users, but find it frustrating when syntax becomes the roadblock.

I guess what I'm really looking for is "Kixforms for Dummies" to get me off the ground...

Cheers...


Bonji
(Starting to like KiXtart)
2002-08-16 08:49 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

I sent an email to you Shawn with the script and some additional info.
The code should work in any environment without changes. It could probably use a little cleanup as I haven't gone over it cosmetically at this point. But anyway, here it is...

*UPDATE* I just added functionality so that the script gets the Minimum Password Value from the Domain and uses that to check against the length of the new password set instead of just using the number 6. Hopefully the new code copies OK [Smile] .
code:
  
BREAK ON

; REQUIRES:
;
; KIXTART 4.02
; KIXFORMS BUILD 27
; WINDOWS 2K/XP
;
; WRITTEN BY SHAWN TASSIE
; MODIFIED BY BEN DULANEY

; Find out if User is an Administrator, if so enable all features
$ADMINUSER=0
$ADSUSER1=GETOBJECT("WinNT://@LDOMAIN/@USERID,User")
FOR EACH $ELEMENT IN $ADSUSER1.GROUPS
IF $ELEMENT.NAME="DOMAIN ADMINS"
$ADMINUSER=1
ENDIF
NEXT

$FORM = CREATEOBJECT("Kixtart.FORM")

$FORM.CAPTION = "User Manager"
$FORM.SCALEHEIGHT = 402
$FORM.SCALEWIDTH = 600
$FORM.FONTNAME = "Arial"
$FORM.FONTSIZE = 9
$FORM.CENTER

$fraBanner = $FORM.PictureBox
$fraBanner.BACKCOLOR = $FORM.RGB(255,255,255)
$fraBanner.HEIGHT = 70
$fraBanner.LEFT = 10
$fraBanner.TOP = 10
$fraBanner.WIDTH = 585

$fraDetails = $FORM.Frame("Details")
$fraDetails.HEIGHT = 300
$fraDetails.LEFT = 8
$fraDetails.TOP = 95
$fraDetails.WIDTH = 585

$txtUsername = $fraDetails.TextBox
$txtUsername.HEIGHT = 19
$txtUsername.LEFT = 104
$txtUsername.TOP = 24
$txtUsername.Text = ""
$txtUsername.WIDTH = 161

$cmdFindUser = $fraDetails.CommandButton("Find User")
$cmdFindUser.DEFAULT = 1 ; True
$cmdFindUser.FONTNAME = "Arial"
$cmdFindUser.FONTSIZE = 10
$cmdFindUser.FONTBOLD = 1
$cmdFindUser.LEFT = 272
$cmdFindUser.TOP = 24
$cmdFindUser.WIDTH = 129
$cmdFindUser.HEIGHT = 19
$cmdFindUser.OnClick = "cmdFindUser_Click()"

$txtDisplayName = $fraDetails.TextBox
$txtDisplayName.HEIGHT = 19
$txtDisplayName.LEFT = 104
$txtDisplayName.TabStop = 0 ; False
$txtDisplayName.TOP = 56
$txtDisplayName.WIDTH = 297
$txtDisplayName.Enabled = 1
$txtDisplayName.BACKCOLOR = $FORM.BACKCOLOR

$lblDisplayName = $fraDetails.Label("Full Name:")
$lblDisplayName.WIDTH = 75
$lblDisplayName.LEFT = $txtDisplayName.LEFT - $lblDisplayName.WIDTH
$lblDisplayName.TOP = $txtDisplayName.TOP

$txtPassword = $fraDetails.TextBox
$txtPassword.HEIGHT = 19
$txtPassword.LEFT = 104
$txtPassword.PasswordChar = ""
$txtPassword.TOP = 88
$txtPassword.WIDTH = 161
$txtPassword.Enabled = 0

$cmdSetPassword = $fraDetails.CommandButton("Set Password")
$cmdSetPassword.FONTNAME = "Arial"
$cmdSetPassword.FONTSIZE = 10
$cmdSetPassword.FONTBOLD = 1
$cmdSetPassword.LEFT = 272
$cmdSetPassword.TOP = 88
$cmdSetPassword.WIDTH = 129
$cmdSetPassword.HEIGHT = 19
$cmdSetPassword.Enabled = 0
$cmdSetPassword.OnClick = "cmdSetPassword_Click()"

$txtExpiryDate = $fraDetails.TextBox
$txtExpiryDate.HEIGHT = 19
$txtExpiryDate.LEFT = 104
$txtExpiryDate.TOP = 120
$txtExpiryDate.WIDTH = 161
$txtExpiryDate.Enabled = 0

$lblPassword = $fraDetails.Label("Password:")
$lblPassword.WIDTH = 75
$lblPassword.LEFT = $txtPassword.LEFT - $lblPassword.WIDTH
$lblPassword.TOP = $txtPassword.TOP

$lblExpiryDate = $fraDetails.Label("Expire Date:")
$lblExpiryDate.WIDTH = 75
$lblExpiryDate.LEFT = $txtExpiryDate.LEFT - $lblExpiryDate.WIDTH
$lblExpiryDate.TOP = $txtExpiryDate.TOP

$cmdChangeExpiryDate = $fraDetails.CommandButton("Change Date")
$cmdChangeExpiryDate.FONTNAME = "Arial"
$cmdChangeExpiryDate.FONTSIZE = 10
$cmdChangeExpiryDate.FONTBOLD = 1
$cmdChangeExpiryDate.LEFT = 272
$cmdChangeExpiryDate.TOP = 120
$cmdChangeExpiryDate.WIDTH = 129
$cmdChangeExpiryDate.HEIGHT = 19
$cmdChangeExpiryDate.OnClick = "cmdChangeExpiryDate_Click()"
$cmdChangeExpiryDate.Enabled = 0

$lstGroups = $fraDetails.ListBox
$lstGroups.HEIGHT = 134
$lstGroups.LEFT = 104
$lstGroups.TOP = 152
$lstGroups.WIDTH = 297
$lstGroups.Enabled = 0

$lblGroups = $fraDetails.Label("Groups:")
$lblGroups.WIDTH = 75
$lblGroups.LEFT = $lstGroups.LEFT - $lblGroups.WIDTH
$lblGroups.TOP = $lstGroups.TOP

$txtBadLoginCount = $fraDetails.TextBox
$txtBadLoginCount.HEIGHT = 19
$txtBadLoginCount.LEFT = 9 + 420 + 75
$txtBadLoginCount.TabStop = 0 ; False
$txtBadLoginCount.TOP = 26 + 20 + 105
$txtBadLoginCount.WIDTH = 20
$txtBadLoginCount.BACKCOLOR = $FORM.BACKCOLOR

$lblBadLoginCount = $fraDetails.Label("Bad Logins:")
$lblBadLoginCount.WIDTH = 75
$lblBadLoginCount.LEFT = 9 + 420 ; X + Y (Y = $fraStatus.LEFT)
$lblBadLoginCount.TOP = 26 + 20 + 105 ; X + Y + Z
CHOPPED (Y = $fraStatus.TOP & Z = $fraStatus.HEIGHT)

$cmdExit = $fraDetails.CommandButton("Exit")
$cmdExit.FONTNAME = "Arial"
$cmdExit.FONTSIZE = 10
$cmdExit.FONTBOLD = 1
$cmdExit.TOP = 267
$cmdExit.WIDTH = 129
$cmdExit.HEIGHT = 19
$cmdExit.LEFT = 445
$cmdExit.OnClick = "quit()"

$fraStatus = $fraDetails.Frame
$fraStatus.BACKCOLOR = $FORM.BACKCOLOR
$fraStatus.CAPTION = "Account Status"
$fraStatus.HEIGHT = 105
$fraStatus.LEFT = 420 ; 416
$fraStatus.TOP = 20 ; 224
$fraStatus.WIDTH = 155

$chkAccountDisabled = $fraStatus.CheckBox("Account Disabled")
$chkAccountDisabled.LEFT = 10
$chkAccountDisabled.TabStop = 0 ; False
$chkAccountDisabled.TOP = 24
$chkAccountDisabled.OnClick = "chkAccountDisabled_Click()"
$chkAccountDisabled.Enabled = 0

$chkAccountLocked = $fraStatus.CheckBox("Account Locked")
$chkAccountLocked.CAPTION = "Account Locked"
$chkAccountLocked.LEFT = 10
$chkAccountLocked.TabStop = 0 ; False
$chkAccountLocked.TOP = 56
$chkAccountLocked.OnClick = "chkAccountLocked_Click()"
$chkAccountLocked.Enabled = 0

$lblUsername = $fraDetails.Label
$lblUsername.CAPTION = "Username:"
$lblUsername.HEIGHT = $txtUsername.HEIGHT
$lblUsername.WIDTH = 75
$lblUsername.LEFT = $txtUsername.LEFT - $lblUsername.WIDTH
$lblUsername.TOP = $txtUsername.TOP

; Draw on the banner

$fraBanner.FONTSIZE = 20
$fraBanner.FONTNAME = "verdana"
$fraBanner.ForeColor = 0
$fraBanner.PrintXY(20,0,"User Manager")
$fraBanner.FONTSIZE = 8
$fraBanner.ForeColor = $FORM.RGB(0,100,100)
$fraBanner.PrintXY(23,32,"Powered by KiX v@KIX and Kixforms Build 27")
$fraBanner.FONTBOLD = 1
$fraBanner.FONTSIZE = 11
$fraBanner.PrintXY(23,46,"Welcome @FULLNAME")
$fraBanner.FONTBOLD = 0
$fraBanner.FONTSIZE = 10

Dim $strUserName
Dim $strUserPath
Dim $strDomainPath

$txtUsername.SelLength = Len($txtUsername.Text)

$FORM.Show
$txtUsername.SetFocus

While $FORM.Visible
$=Execute($FORM.DoEvents)
Loop

Exit 1

Function cmdFindUser_Click()
Dim $Wait
$Wait = CREATEOBJECT("Kixtart.FORM")
$Wait.CAPTION = "One moment please..."
$Wait.SCALEWIDTH = 500
$Wait.SCALEHEIGHT = 100
$Wait.FONTSIZE = 14
$Wait.FONTNAME = "Arial"
$Wait.PrintXY(30,30,"Searching Active Directory, one moment please...")
$Wait.CENTER

Dim $adsUser,$adsGroup

If $txtUsername.Text = ""
$= $FORM.MsgBox("You must specify a username before
CHOPPED clicking Find.", "Username invalid")
$txtUsername.Text = $strUserName
Exit Sub
Else
$strUserName = $txtUsername.Text
Endif

$Wait.Show
$strUserPath = "WinNT://@LDOMAIN/$strUserName,User"
$adsUser = GetObject($strUserPath)
If Not $adsUser
; User does not exist
$= $FORM.MsgBox("A user called (" + $txtUsername.Text + ")
CHOPPED does not exist.", "Username invalid")
; Disable the controls
$chkAccountDisabled.Enabled = 0
$cmdSetPassword.Enabled = 0
$cmdChangeExpiryDate.Enabled = 0
$txtPassword.Enabled = 0
$cmdChangeExpiryDate.Enabled = 0
$txtPassword.Text = ""
$txtDisplayName.Text = ""
$txtExpiryDate.Text = ""
$txtBadLoginCount.Text = ""
$lstGroups.Clear
Else
$txtPassword.Text = ""
$txtDisplayName.Text = ""
$txtExpiryDate.Text = ""
$txtBadLoginCount.Text = ""
$lstGroups.Clear
$lstGroups.

; User exists so bind to it
$adsUser.GetInfo
$txtDisplayName.Text = $adsUser.FullName
$txtExpiryDate.Text = $adsUser.AccountExpirationDate

If $adsUser.AccountDisabled
; Check the disabled box
$chkAccountDisabled.Value = 1
Else

; Uncheck the disabled box
$chkAccountDisabled.Value = 0
EndIf

If $adsUser.IsAccountLocked
; Check the locked box
$chkAccountLocked.Value = 1
; Enable the checkbox so that the account can be unlocked
$chkAccountLocked.Enabled = 1
Else
; Uncheck the locked box
$chkAccountLocked.Value = 0
EndIf

For Each $adsGroup In $adsUser.Groups
$lstGroups.AddItem ($adsGroup.Name)
Next

$strBLC = $adsUser.BadLoginCount
If @ERROR
$txtBadLoginCount.Text = 0
Else
$txtBadLoginCount.Text = $strBLC
EndIf

;Enable the controls
$chkAccountDisabled.Enabled = $ADMINUSER
$cmdSetPassword.Enabled = 1
$cmdChangeExpiryDate.Enabled = $ADMINUSER
$txtPassword.Enabled = 1
$txtExpiryDate.Enabled = $ADMINUSER
$lstGroups.Enabled = 1
$adsUser = 0
$adsGroup = 0
$txtUsername.SetFocus
Endif
$FORM.Refresh
$txtUsername.SetFocus
EndFunction

Function chkAccountDisabled_Click()
Dim $adsUser
$adsUser = GetObject($strUserPath)
If $chkAccountDisabled.Value = 0
; Enable account
$adsUser.AccountDisabled = 0
$adsUser.SetInfo
IF @ERROR=0
$=$FORM.MsgBox("The user (" + $strUserName + ") has
CHOPPED been enabled.", "User enabled")
ELSE
$=$FORM.MsgBox("The user (" + $strUserName + ") could
CHOPPED not be enabled.","Not Authorized")
ENDIF
Else
; Disable Account
$adsUser.AccountDisabled = 1
$adsUser.SetInfo
IF @ERROR=0
$= $FORM.MsgBox("The user (" + $strUserName + ") has
CHOPPED been disabled.", "User disabled")
ELSE
$=$FORM.MsgBox("The user (" + $strUserName + ") could
CHOPPED not be disabled.","Not Authorized")
ENDIF
EndIf
$adsUser = 0
EndFunction

Function chkAccountLocked_Click()
Dim $adsUser
If $chkAccountLocked.Value = 0
; Unlock the account
$adsUser = GetObject($strUserPath)
$adsUser.IsAccountLocked = 0
$adsUser.SetInfo
IF @ERROR=0
$=$FORM.MsgBox("The user (" + $strUserName + ") has
CHOPPED been unlocked.", "User enabled")
ELSE
$=$FORM.MsgBox("The user (" + $strUserName + ") could
CHOPPED not be unlocked.","Not Authorized")
$chkAccountLocked.Value = 1
ENDIF
EndIf
; Disable the checkbox
$chkAccountLocked.Enabled = 0
$adsUser = Nothing
EndFunction

Function cmdSetPassword_Click()
; Get Minimum Password Length Allowed from Domain Policy
$strDomainPath="WinNT://@LDOMAIN,Domain"
$adsDomain = GetObject($strDomainPath)
$intMinPasswordLength=$adsDomain.MinPasswordLength
$adsDomain = Nothing

$adsUser = GetObject($strUserPath)
If $txtPassword.Text = ""
$= $FORM.MsgBox("The password cannot be empty.", "User
CHOPPED password change")
Else
If Len($txtPassword.Text) < $intMinPasswordLength
$= $FORM.MsgBox("The password cannot be less than " +
CHOPPED $intMinPasswordLength + " characters long.",
CHOPPED "User password change")
Else
$adsUser.SetPassword($txtPassword.Text)
IF @ERROR=0
$=$FORM.MsgBox("The password has been changed
CHOPPED to (" + $txtPassword.Text + ").", "User Password Change")
ELSE
$=$FORM.MsgBox("The password could not be
CHOPPED changed.","Not Authorized")
ENDIF
EndIf
EndIf
$txtPassword.Text = ""
$adsUser = Nothing
EndFunction

Function cmdChangeExpiryDate_Click()
Dim $adsUser
$adsUser = GetObject($strUserPath)
If $txtExpiryDate.Text = ""
$= $FORM.MsgBox("The expiration date cannot be empty.",
CHOPPED "User expire date change")
$txtExpiryDate.Text = $adsUser.AccountExpirationDate
Else
$adsUser.AccountExpirationDate = $txtExpiryDate.Text
$adsUser.SetInfo
If @ERROR
$= $FORM.MsgBox("Expiration date has not been changed
CHOPPED due to an error.", "User expire date change")
Else
$= $FORM.MsgBox("Expiration date is changed to (" +
CHOPPED $txtExpiryDate.Text + ").", "User expire date change")
EndIf
EndIf
$adsUser = Nothing
EndFunction

BTW, I compacted a few lines so the post wouldn't be so wide. I added the word 'CHOPPED' in front of those lines to make it easy to fix. If someone can tell me how to do that without breaking the code I'll go back and fix it. If it's cut and pasted, it will not work without those lines being fixed.

Thanks,
Ben

[ 16. August 2002, 21:51: Message edited by: Ben Dulaney ]


Waltz
(Seasoned Scripter)
2002-08-16 09:37 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Ben...

This is a good thing...
Thanks for posting the code...

One minor problem that I've encountered...
A non-admin user can't do the scroll thingie in the Groups window and thus cannot view all the info. Short of re-sizing the form/window is there a way to activate the scroll bar and still maintain the non-admin restriction?


Bonji
(Starting to like KiXtart)
2002-08-16 09:46 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Waltz,

I modified my code above to reflect the change. There's no good reason to turn off groups just because the user is not an admin. The groups cannot be manipulated from this program (currently). I just changed the line...

$lstGroups.Enabled = $ADMINUSER
to
$lstGroups.Enabled = 1

This causes the Groups window to be enabled for all users. Let me know if you find anything else. Thanks for the input.

Ben


Waltz
(Seasoned Scripter)
2002-08-16 10:19 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

[Roll Eyes]
Ben..
It must be time to call it a day...
I had found my way to the right spot in the code, but my fuzzy logic switched the 0 and 1, so I was doing a lstGroup.Enabled = the_opposite_value_to_what_I_wanted.
Anyway, it's sorted now and works as expected.

I off to the beach for the weekend now to write the almost perfect 2 line code:
Turn debug off
Do what I'm thinking

Cheers....


LonkeroAdministrator
(KiX Master Guru)
2002-08-18 12:46 AM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

ben, you can avoid those long lines by taking of your code from the code tags.
you can use html to make nicer.
like:

code:


Function cmdChangeExpiryDate_Click()
          Dim $adsUser
      $adsUser = GetObject($strUserPath)
          If $txtExpiryDate.Text = ""
                        $= $FORM.MsgBox("The expiration date cannot be empty.", "User expire date change")
                          $txtExpiryDate.Text = $adsUser.AccountExpirationDate
      Else
                      $adsUser.AccountExpirationDate = $txtExpiryDate.Text
                      $adsUser.SetInfo
                              If @ERROR
                                            $= $FORM.MsgBox("Expiration date has not been changed due to an error.", "User expire date change")
                    Else
                                      $= $FORM.MsgBox("Expiration date is changed to (" + $txtExpiryDate.Text + ").", "User expire date change")
                  EndIf
    EndIf
    $adsUser = Nothing
EndFunction




just came to my mind, there are tools too for doing this... just can't remember the site...


[ 17. August 2002, 13:00: Message edited by: Lonkero ]


Richie19Rich77
(Seasoned Scripter)
2002-08-19 05:22 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Hi

This script is just what I want but I would like to modify it so when a user types in the new password it will set that user to change password on next logon.

Where did you get all the codes for changing password and other stuff within the Active Domain.

Thanks

Richard


ShawnAdministrator
(KiX Supporter)
2002-08-19 05:47 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Ben,

Not too sure if you noticed or not, but I included your modified USRMGR.KIX with the Kixforms distribution ... and added a small picture icon in the banner box ...


Bonji
(Starting to like KiXtart)
2002-08-20 02:35 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Richard,

Good point on expiring the password. I'm currently looking into it.
I found all the information on Users, Domains, Computers, Groups, etc. at http://msdn.microsoft.com/library/en-us/netdir/adsi/iadsuser.asp

Shawn,
Including the script sounds great. Hopefully it will be a useful training tool as well as a useful utility. I'm planning on writing a much more extensive tool that can perform most administrative functions (that ADSI will allow and that I use). I'll post that one if I ever get it finished.

Thanks,
Ben


Peter Fry
(Getting the hang of it)
2002-08-20 02:47 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Richard

I wanted to do simular here is what i did
just add the following line after it sets the password

$adsUser.put("PasswordExpired", 1)

this will force the user to change password when he logs in

hope this helps

Pete


Bonji
(Starting to like KiXtart)
2002-08-20 03:51 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Pete,

Good save! I am going to add a box that shows the status of that variable. It will be enabled for admins and disabled for non-admins. In addition, when a non-admin changes the password the new box will reflect an expired password. Admins will be able to unexpire it if they choose.
Instead of posting the changes time and again, I'll set up a link to our website that will have a link to the code, assuming this is an acceptable method for getting to the code.

One question though, were did you find reference to the PasswordExpired? I could not find that one.

Thanks,
Ben


Peter Fry
(Getting the hang of it)
2002-08-20 04:02 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

ok here goes [Smile]

this is what i've done [Smile] so it makes it nice and simple, i wanted a new gui interface that would allow key users (VERY limited admin access) to complete 2 things

1) reset passwords
2) unlock accounts

here is my code (yes i based this on shawns code)
code:
  

; Used to hide the command window when complied into an .exe using kixcrypt.exe and kixforms
; Set at the top so that is it the first command used
SETCONSOLE("hide")

; Created by Peter Fry
; Created on "8 August 2002"
;
; REQUIRES:
; KIXTART 4.10 - Kix32.exe in %windir%\system32
; KIXFORMS BUILD 21 - kixforms.dll in %windir%\system32 and registered with "regsvr32 kixforms.dll"
; An active directory enabled machine

; Version
$VERSION = "V2 Beta"

; Version History
;
; V1 beta = Text based only - small progress bar - Filename: key_beta_1.kix
; V2 beta = GUI Interface added - Filename: key_beta_2.kix

; Enable Logging (1 = enabled and 0 = disabled)
$LOGGING = 1

; Name of Program : Key User Scripts
;
; Use of the Program
;
; This program is intened to allow key users (apart of the account operator group)
; It will allow them to do the following
;
; 1) Reset a given users password to the string set in the variable $PASSWORD
;
; 2) Unlock a locked account

BREAK ON ; enables canceling of the script without auto rebooting.
; DEBUG ON ; uncomment this to enable debuging

; SET Variables
$FILE_SERVER = "SH1391"
$PASSWORD = "123456"
$NOTAUTHORISED ="\\$FILE_SERVER\keyuser$\notauthorised.csv" ;file 1
$RUNLOG = "\\$FILE_SERVER\keyuser$\runlog.csv" ;file 2
$UNLOCKLOG = "\\$FILE_SERVER\keyuser$\unlocklog.csv" ;file 3
$PASSWORDLOG = "\\$FILE_SERVER\keyuser$\passwordlog.csv" ;file 4

; Authorise the user
$AUTH = CreateObject("Kixtart.Form") ; Create a form called $AUTH
$AUTH.Caption = "Authorising @USERID, Please Wait"
$AUTH.ScaleWidth = 500
$AUTH.ScaleHeight = 100
$AUTH.FontSize = 14
$AUTH.FontName = "Arial"
$AUTH.PrintXY(30,30,"Please Wait......")
$AUTH.Center
$AUTH.show

IF ingroup("Account Operators") = 1
$= $AUTH.MsgBox("You are Authorised to run this program", "Authorised")
$AUTHORISED = "YES"
ELSE
$= $AUTH.MsgBox("You are NOT Authorised to run this program", "NOT Authorised")
$AUTHORISED = "NO"
IF $LOGGING = 1
$NUL=Open(1,$NOTAUTHORISED,5)
$NUL=writeline (1,"@USERID,@DATE,@TIME,$AUTHORISED" + Chr(13) + Chr(10))
$NUL=CLOSE(1)
ENDIF
quit()
ENDIF

$AUTH = 0 ;Close the form called $AUTH

; Runlog
IF $LOGGING = 1
$NUL=Open(2,$RUNLOG,5)
$NUL=writeline (2,"@USERID,@DATE,@TIME,$AUTHORISED" + Chr(13) + Chr(10))
$NUL=CLOSE(2)
ENDIF

; Form Vars
$FORM = CreateObject("Kixtart.Form") ; Create form called $FORM
$FORM.Caption = "Key User Commands $VERSION"
$FORM.ScaleHeight = 300
$FORM.ScaleWidth = 425
$FORM.FontName = "Arial"
$FORM.FontSize = 9
$FORM.Center

$FRABANNER = $FORM.PictureBox
$FRABANNER.BackColor = $FORM.RGB(255,255,255)
$FRABANNER.Height = 137
$FRABANNER.Left = 8
$FRABANNER.Top = 10
$FRABANNER.Width = 410

$FRADETAILS = $FORM.Frame("Details")
$FRADETAILS.Height = 140
$FRADETAILS.Left = 8
$FRADETAILS.Top = 152
$FRADETAILS.Width = 410

$CMDEXIT = $FRADETAILS.CommandButton("Exit!")
$CMDEXIT.FontName = "Comic Sans MS"
$CMDEXIT.FontSize = 12
$CMDEXIT.FontBold = 1
$CMDEXIT.Top = 114
$CMDEXIT.Width = 129
$CMDEXIT.Left = 272
$CMDEXIT.HEIGHT = 22
$CMDEXIT.OnClick = "quit()"

$TXTUSERNAME = $FRADETAILS.TextBox
$TXTUSERNAME.Height = 25
$TXTUSERNAME.Left = 104
$TXTUSERNAME.Top = 24
$TXTUSERNAME.Text = ""
$TXTUSERNAME.Width = 161

$CMDFINDUSER = $FRADETAILS.CommandButton("Find User!")
$CMDFINDUSER.Default = 1 ; True
$CMDFINDUSER.FontName = "Comic Sans MS"
$CMDFINDUSER.FontSize = 12
$CMDFINDUSER.FontBold = 1
$CMDFINDUSER.Left = 272
$CMDFINDUSER.Top = 24
$CMDFINDUSER.Width = 129
$CMDFINDUSER.HEIGHT = 22
$CMDFINDUSER.OnClick = "cmdFindUser_Click()"

$LABEL_USERNAME = $FRADETAILS.Label
$LABEL_USERNAME.Caption = "Username:"
$LABEL_USERNAME.Height = $TXTUSERNAME.Height
$LABEL_USERNAME.Width = 75
$LABEL_USERNAME.Left = $TXTUSERNAME.Left - $LABEL_USERNAME.Width
$LABEL_USERNAME.Top = $TXTUSERNAME.Top

$CMDRESET_PASSWORD = $FRADETAILS.CommandButton("Reset Password")
$CMDRESET_PASSWORD.Default = 0 ; True
$CMDRESET_PASSWORD.FontName = "Comic Sans MS"
$CMDRESET_PASSWORD.FontSize = 12
$CMDRESET_PASSWORD.FontBold = 1
$CMDRESET_PASSWORD.Left = 104
$CMDRESET_PASSWORD.Top = 90
$CMDRESET_PASSWORD.Width = 129
$CMDRESET_PASSWORD.HEIGHT = 22
$CMDRESET_PASSWORD.Enabled = 0 ; Disabled / False
$CMDRESET_PASSWORD.OnClick = "Reset_Password()"

$CMDUNLOCK = $FRADETAILS.CommandButton("Unlock Account")
$CMDUNLOCK.Default = 0 ; True
$CMDUNLOCK.FontName = "Comic Sans MS"
$CMDUNLOCK.FontSize = 12
$CMDUNLOCK.FontBold = 1
$CMDUNLOCK.Left = 272
$CMDUNLOCK.Top = 90
$CMDUNLOCK.Width = 129
$CMDUNLOCK.HEIGHT = 22
$CMDUNLOCK.Enabled = 0 ; Disabled / False
$CMDUNLOCK.OnClick = "Unlock_Account()"


$TXTDISPLAYNAME = $FRADETAILS.TextBox
$TXTDISPLAYNAME.Height = 25
$TXTDISPLAYNAME.Left = 104
$TXTDISPLAYNAME.TabStop = 0 ; False
$TXTDISPLAYNAME.Top = 56
$TXTDISPLAYNAME.Width = 297
$TXTDISPLAYNAME.Enabled = 1
$TXTDISPLAYNAME.BackColor = $FORM.BackColor

$LABEL_DISPLAYNAME = $FRADETAILS.Label("Full Name:")
$LABEL_DISPLAYNAME.Width = 75
$LABEL_DISPLAYNAME.Left = $TXTDISPLAYNAME.Left - $LABEL_DISPLAYNAME.Width
$LABEL_DISPLAYNAME.Top = $TXTDISPLAYNAME.Top

; Draw on the banner
$FRABANNER.FontSize = 16
$FRABANNER.FontName = "verdana"
$FRABANNER.FontSize = 28
$FRABANNER.ForeColor = $FORM.RGB(100,200,200)
$FRABANNER.PrintXY(13,10,"Key User Commands")
$FRABANNER.ForeColor = 0
$FRABANNER.PrintXY(10,7,"Key User Commands")
$FRABANNER.FontSize = 12
$FRABANNER.ForeColor = $FORM.RGB(0,100,100)
$FRABANNER.PrintXY(13,58,"Created By Peter Fry")
$FRABANNER.FontBold = 1
$FRABANNER.PrintXY(13,80,"Welcome @USERID")
$FRABANNER.FontBold = 0
$FRABANNER.FontSize = 10
$FRABANNER.ForeColor = $FORM.RGB(0,100,100)

DIM $STRUSERNAME
DIM $STRUSERPATH

$FORM.Show
$TXTUSERNAME.SetFocus

WHILE $FORM.Visible
$=Execute($FORM.DoEvents)
LOOP

$FORM = 0 ;Close the form called $FORM

EXIT 1

FUNCTION cmdFindUser_Click()

DIM $WAIT
$WAIT = CreateObject("Kixtart.Form") ; Create form called $WAIT
$WAIT.Caption = "One moment please..."
$WAIT.ScaleWidth = 425
$WAIT.ScaleHeight = 100
$WAIT.FontSize = 14
$WAIT.FontName = "Arial"
$WAIT.PrintXY(30,30,"Searching for User, one moment please...")
$WAIT.Center
DIM $USERACCOUNT,$adsGroup
IF $TXTUSERNAME.Text = ""
$= $FORM.MsgBox("You must specIFy a username before clicking Find.", "Username invalid")
$TXTUSERNAME.Text = $STRUSERNAME
EXIT Sub
ELSE
$STRUSERNAME = $TXTUSERNAME.Text
ENDIF
$WAIT.Show
$STRUSERPATH = "WinNT://@LDOMAIN/$STRUSERNAME,User"
$USERACCOUNT = GetObject($STRUSERPATH)
IF Not $USERACCOUNT
; User does not exist
$= $FORM.MsgBox("A user called (" + $TXTUSERNAME.Text + ") does not exist.", "Username invalid")
ELSE
; User exists so bind to it
$USERACCOUNT.GetInfo
$TXTDISPLAYNAME.Text = $USERACCOUNT.FullName
$CMDRESET_PASSWORD.Enabled = 1 ; Enable the reset password button
$CMDFINDUSER.Enabled = 0 ; Disable the finduser button
IF $USERACCOUNT.IsAccountLocked

$CMDUNLOCK.Enabled = 1 ; Enable the unlock button
$CMDRESET_PASSWORD.Enabled = 0 ; disable the reset password button
ENDIF
ENDIF
$FORM.Refresh
$TXTUSERNAME.SetFocus

ENDFUNCTION

FUNCTION Unlock_Account()

$WAIT = CreateObject("Kixtart.Form") ; Create form called $WAIT
$WAIT.Caption = "One moment please..."
$WAIT.ScaleWidth = 425
$WAIT.ScaleHeight = 100
$WAIT.FontSize = 14
$WAIT.FontName = "Arial"
$WAIT.PrintXY(30,30,"Unlocking Account, one moment please...")
$WAIT.Center
$WAIT.Show
DIM $USERACCOUNT
; APPEND to $UNLOCKLOG
IF $LOGGING = 1
$USERNAME = $TXTUSERNAME.Text
$NUL=Open(3,$UNLOCKLOG,5)
$NUL=writeline (3,"@USERID,$USERNAME,@DATE,@TIME" + Chr(13) + Chr(10))
$NUL=CLOSE(3)
ENDIF
; Unlock the account
$USERACCOUNT = GetObject($STRUSERPATH)
$USERACCOUNT.GetInfo
$USERACCOUNT.IsAccountLocked = 0
$USERACCOUNT.SetInfo
$= $FORM.MsgBox("The user (" + $STRUSERNAME + ") has been unlocked.", "User enabled")
$WAIT = 0 ; close the form called $WAIT
$USERACCOUNT = 0
$FORM.Refresh
$CMDEXIT.SetFocus
$CMDUNLOCK.Enabled = 0 ; Disable the unlock button
reset_password()

ENDFUNCTION

FUNCTION Reset_Password()

$WAIT = CreateObject("Kixtart.Form") ; Create form called $WAIT
$WAIT.Caption = "One moment please..."
$WAIT.ScaleWidth = 425
$WAIT.ScaleHeight = 100
$WAIT.FontSize = 14
$WAIT.FontName = "Arial"
$WAIT.PrintXY(30,30,"Resetting Password, one moment please...")
$WAIT.Center
$WAIT.Show
DIM $USERACCOUNT
; APPEND to $PASSWORDLOG
IF $LOGGING = 1
$USERNAME = $TXTUSERNAME.Text
$NUL=Open(4,$PASSWORDLOG,5)
$NUL=writeline (4,"@USERID,$USERNAME,@DATE,@TIME" + Chr(13) + Chr(10))
$NUL=CLOSE(4)
ENDIF
; Reset the pasword on the account
$USERACCOUNT = GetObject($STRUSERPATH)
$USERACCOUNT.GetInfo
$USERACCOUNT.setpassword("$PASSWORD")
$USERACCOUNT.put("PasswordExpired", 1)
$USERACCOUNT.setinfo
$= $FORM.MsgBox("The password for user (" + $STRUSERNAME + ") has been Reset.", "Password Reset")
$WAIT = 0 ; close the form called $WAIT
$USERACCOUNT = 0
$FORM.Refresh
$CMDEXIT.SetFocus
$CMDRESET_PASSWORD.Enabled = 0 ; Disable the reset password button

ENDFUNCTION

this does lots of logging and checks if the person running the file (i'm using kixcrypt to make it an exe) is in the account operators group

check it out and comments would be great

this is a very much scaled down version of shawns MUD because i didn't need and i didn't want to show the users all the power they had [Smile]

hope this helps

btw i found the expiredpassword somewhere on this board [Smile] (sorry) i also use adsi25.chm which i downloaded from microsofts website

Pete

p.s. hope you don't mind me using your code shawn


Bonji
(Starting to like KiXtart)
2002-08-20 05:01 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

I found the adsi25.chm file. It should be very helpful.

I've got the Password Expired checkbox in and working now. You can get the latest version of this script at
http://www.rgcweb.org:90

My script should take into account a user's authorization to change passwords and such (based on their authorization to make the changes). It also does not limit a user to belonging to the Account Operators group as they can be assigned Set Password permissions to a group of users and still be able to manage the accounts with this tool. If they are not an admin user they can only change the password and unlock an account.
Here's an example of why I included the other information for non-admins. Our manager in a remote facility can reset passwords on all users in that facility. If a user comes to him/her stating they cannot logon, the manager can see all the reasons that person cannot sign on if it's not a password issue. i.e. disabled account, expired account. Plus I don't think it does any harm for the manager to see what groups the user is a member of.

Just my 2 cents [Smile]

Thanks,
Ben

[ 20. August 2002, 17:08: Message edited by: Ben Dulaney ]


Peter Fry
(Getting the hang of it)
2002-08-20 05:09 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Ben

Good points [Smile] , i just wanted to use the inbuilt groups (in NT) to get this to work as i didn't want to mess around with adding permissions to other groups/ users (just call me lazy)

script is looking good btw [Smile]

Pete


ShawnAdministrator
(KiX Supporter)
2002-08-20 05:25 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Hey guys, I added some new features to Kixforms 2.0.2 ... one them specific to what you guys are doing ...

The TEXTBOX object now supports the LOCKED property ... thought it might be usefull for that READONLY description field.

Might want to check-out some new BORDERSTYLE values for ALL objects:

0 = None
1 = Line
2 = Sunken
3 = Raised
4 = Framed

I think Rodney will be making the new build available shortly, on the Kixforms Website.

-Shawn

[ 20. August 2002, 17:26: Message edited by: Shawn ]


Bonji
(Starting to like KiXtart)
2002-08-20 05:38 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

I just posted a change to the code. I forgot to make the password expire when the password is changed. Now it does that automatically.

Great news on Kixforms Shawn. I'm really enjoying working with it. Does this version support W9X? I'm wanting to convert my logon script to Kixforms, however we still have many W9X machines around.

Please let me know if there are any suggestions to improve my code. Thanks for the ones already made. It is a much better script now for it. [Smile]

Thanks,
Ben


Peter Fry
(Getting the hang of it)
2002-08-20 05:59 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Ben

why not just use a reset password button (like mine) that sets it to 123456 i.e. $PASSWORD variable

because if you are setting it to expire when you change the password you might as well set it to a default password [Smile]

and 123456 is a password peeps can't get wrong [Smile] i.e. no asking questions like is that upper or lower case etc

just an idea [Smile]

Pete


rclarke
(Starting to like KiXtart)
2002-08-20 06:03 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

KiXforms 2.0.2 is now uploaded and available from the downloads page on the KiXforms Website. Enjoy [Wink]

Borte
(Fresh Scripter)
2002-08-20 06:14 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Hello Everybody!

A little off topic but...

Shawn: An comment on the locked property:

In VB is it possible to set an txtbox as enabled to false and locked to true to get a textbox look like an label, but with all the properties of an textbox. Is this possible in KixForms?
I've tried to achive this but the textbox is always ending up with the text grayed out.

The function would be fullfilled if the forecolor of this textbox didn't change to gray but stayed the same if the value locked is true and enabled is false.

Any ideas?

I'm trying to show information to the user, but the text is to big to fit in one label field so i have to use multiple. Not a good solution!

Borte


Bonji
(Starting to like KiXtart)
2002-08-20 06:22 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Pete,

That's a good thought. I will add an extra button to set the password to a predefined variable (since this will be the case most of the time). However, I will be using the tool myself to manage accounts and I will need the extra flexibility to set a password to a value that is needed at that time. i.e. an Exchange service account password may need to be set/changed. I'll post when I've added that in. I'll put the two hard-coded variables at the top of the code for easier modification.

Ben


Bonji
(Starting to like KiXtart)
2002-08-20 06:43 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

I added the button to Reset a password. I shortened the Full Name line to get my button to fit. I don't need it longer, but if it bothers some I can rework the form to make it all fit properly. Set Password is now an Admin-only feature. I think this is a good compromise. [Smile]

Ben
http://www.rgcweb.org:90


Peter Fry
(Getting the hang of it)
2002-08-21 01:04 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Ben

Small comment, is there any point setting the password to expire when the admin sets the password to a certain word? because the first thing they will do is uncheck the password expired box

Regards

Pete


Richie19Rich77
(Seasoned Scripter)
2002-08-21 01:14 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

I have setup my script to reset the password and then make user change password on next logon.

This script would be used by the helpdesk staff for resetting passwords, and when the script is excuted the password would be set to a default say 123456.

Then when user logs in, they will be prompted to change password.

We have been using this procedure on our unix boxes for the last 10 years, and have had no problems.

Richard Farthing


LonkeroAdministrator
(KiX Master Guru)
2002-08-21 02:08 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

and actually to make it sure, the way richard is using it... it works.

when trying to set the expire time for non expiring passwords it will fail.


Chris S.
(MM club member)
2002-08-21 02:44 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

To Jooel's point, you may want to check the account to see if the "Password Never Expires" flag is set. See my post on Find Expired NT Accounts Using ADSI for a method of checking for this flag.

LonkeroAdministrator
(KiX Master Guru)
2002-08-21 02:54 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

I also did collect so sort of script (which only does this task -> reset user password and set the flag) in:
http://www.kixtart.org/board/ultimatebb.php?ubb=get_topic;f=2;t=003698#000004

I quess richard perhaps even uses currently something similar...


Richie19Rich77
(Seasoned Scripter)
2002-08-21 04:40 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Ok Here is my script, was posted before but made some changes.

Richard Farthing

code:
 
; Used to hide the command window when complied into an .exe using kixcrypt.exe and kixforms
; Set at the top so that is it the first command used
SETCONSOLE("hide")

; Created by Richard Farthing
; Created on "15th August 2002"
;
; REQUIRES:
; KIXTART 4.10 - Kix32.exe in %windir%\system32
; KIXFORMS BUILD 21 - kixforms.dll in %windir%\system32 and registered with "regsvr32 kixforms.dll"
; An active directory enabled machine

; Version
$VERSION = "V1.1"


; Enable Logging (1 = enabled and 0 = disabled)
$LOGGING = 1

; Name of Program : Key User Scripts
;
; Use of the Program
;
; This program is intened to allow key users (apart of the account operator group)
; It will allow them to do the following
;
; 1) Reset a given users password to the string set in the variable $PASSWORD
;
; 2) Unlock a locked account

BREAK ON ; enables canceling of the script without auto rebooting.
; DEBUG ON ; uncomment this to enable debuging

; SET Variables
$FILE_SERVER = "fileprint"
$PASSWORD = "aa123456"
$NOTAUTHORISED ="\\$FILE_SERVER\keyuser$\notauthorised.csv" ;file 1
$RUNLOG = "\\$FILE_SERVER\keyuser$\runlog.csv" ;file 2
$UNLOCKLOG = "\\$FILE_SERVER\keyuser$\unlocklog.csv" ;file 3
$PASSWORDLOG = "\\$FILE_SERVER\keyuser$\passwordlog.csv" ;file 4

; Authorise the user
$AUTH = CreateObject("Kixtart.Form") ; Create a form called $AUTH
$AUTH.Caption = "Authorising @USERID, Please Wait"
$AUTH.ScaleWidth = 475
$AUTH.ScaleHeight = 75
$AUTH.FontSize = 12
$AUTH.FontName = "Arial"
$AUTH.PrintXY(30,30,"Please Wait......")
$AUTH.Center
$AUTH.show

IF ingroup("Account Operators") = 1

$= $AUTH.MsgBox("You are Authorised to run this program", "Authorised")
$AUTHORISED = "YES"

ELSE
$= $AUTH.MsgBox("You are NOT Authorised to run this program", "NOT Authorised")
$AUTHORISED = "NO"


IF $LOGGING = 1
$NUL=Open(1,$NOTAUTHORISED,5)
$NUL=writeline (1,"@USERID,@DATE,@TIME,$AUTHORISED" + Chr(13) + Chr(10))
$NUL=CLOSE(1)
ENDIF
quit()
endif
$AUTH = 0 ;Close the form called $AUTH

; Runlog
IF $LOGGING = 1
$NUL=Open(2,$RUNLOG,5)
$NUL=writeline (2,"@USERID,@DATE,@TIME,$AUTHORISED" + Chr(13) + Chr(10))
$NUL=CLOSE(2)
ENDIF

; Form Vars
$FORM = CreateObject("Kixtart.Form") ; Create form called $FORM
$FORM.Caption = "Password Reset $VERSION - Written by Richard Farthing"
$FORM.ScaleHeight = 215
$FORM.ScaleWidth = 425
$FORM.FontName = "Arial"
$FORM.FontSize = 9
$FORM.Center

$FRABANNER = $FORM.PictureBox
$FRABANNER.BackColor = $FORM.RGB(255,255,255)
$FRABANNER.Height = 75
$FRABANNER.Left = 8
$FRABANNER.Top = 10
$FRABANNER.Width = 410

$FRADETAILS = $FORM.Frame("Details")
$FRADETAILS.Height = 120
$FRADETAILS.Left = 8
$FRADETAILS.Top = 85
$FRADETAILS.Width = 410

$CMDEXIT = $FRADETAILS.CommandButton("Exit!")
$CMDEXIT.FontSize = 12
$CMDEXIT.Top = 85
$CMDEXIT.Width = 129
$CMDEXIT.Left = 272
$CMDEXIT.HEIGHT = 22
$CMDEXIT.OnClick = "quit()"

$TXTUSERNAME = $FRADETAILS.TextBox
$TXTUSERNAME.Height = 25
$TXTUSERNAME.Left = 104
$TXTUSERNAME.Top = 24
$TXTUSERNAME.Text = ""
$TXTUSERNAME.Width = 161

$CMDFINDUSER = $FRADETAILS.CommandButton("Find User!")
$CMDFINDUSER.Default = 1 ; True
$CMDFINDUSER.FontSize = 12
$CMDFINDUSER.Left = 272
$CMDFINDUSER.Top = 24
$CMDFINDUSER.Width = 129
$CMDFINDUSER.HEIGHT = 22
$CMDFINDUSER.OnClick = "cmdFindUser_Click()"

$LABEL_USERNAME = $FRADETAILS.Label
$LABEL_USERNAME.Caption = "Username:"
$LABEL_USERNAME.Height = $TXTUSERNAME.Height
$LABEL_USERNAME.Width = 75
$LABEL_USERNAME.Left = $TXTUSERNAME.Left - $LABEL_USERNAME.Width
$LABEL_USERNAME.Top = $TXTUSERNAME.Top

$CMDRESET_PASSWORD = $FRADETAILS.CommandButton("Reset Password")
$CMDRESET_PASSWORD.Default = 0 ; True
$CMDRESET_PASSWORD.FontSize = 12
$CMDRESET_PASSWORD.Left = 104
$CMDRESET_PASSWORD.Top = 85
$CMDRESET_PASSWORD.Width = 129
$CMDRESET_PASSWORD.HEIGHT = 22
$CMDRESET_PASSWORD.Enabled = 0 ; Disabled / False
$CMDRESET_PASSWORD.OnClick = "Reset_Password()"

$CMDUNLOCK = $FRADETAILS.CommandButton("Unlock Account")
$CMDUNLOCK.Default = 0 ; True
$CMDUNLOCK.FontSize = 12
$CMDUNLOCK.Left = 104
$CMDUNLOCK.Top = 58
$CMDUNLOCK.Width = 129
$CMDUNLOCK.HEIGHT = 22
$CMDUNLOCK.Enabled = 0 ; Disabled / False
$CMDUNLOCK.OnClick = "Unlock_Account()"


; Draw on the banner
$FRABANNER.FontSize = 16
$FRABANNER.FontSize = 16
$FRABANNER.ForeColor = 1
$FRABANNER.PrintXY(50,7,"Client Server - Password Reset")
$FRABANNER.FontSize = 12
$FRABANNER.FontBold = 1
$FRABANNER.PrintXY(110,35,"Welcome @USERID")
$FRABANNER.FontBold = 0
$FRABANNER.FontSize = 10
$FRABANNER.ForeColor = $FORM.RGB(0,100,100)

DIM $STRUSERNAME
DIM $STRUSERPATH

$FORM.Show
$TXTUSERNAME.SetFocus

WHILE $FORM.Visible
$=Execute($FORM.DoEvents)
LOOP

$FORM = 0 ;Close the form called $FORM

EXIT 1

FUNCTION cmdFindUser_Click()

DIM $WAIT
$WAIT = CreateObject("Kixtart.Form") ; Create form called $WAIT
$WAIT.Caption = "One moment please..."
$WAIT.ScaleWidth = 400
$WAIT.ScaleHeight = 75
$WAIT.FontSize = 12
$WAIT.FontName = "Arial"
$WAIT.PrintXY(30,30,"Searching for User, one moment please...")
$WAIT.Center
DIM $USERACCOUNT,$adsGroup
IF $TXTUSERNAME.Text = ""
$= $FORM.MsgBox("You must specify a username before clicking Find.", "Username invalid")
else
IF $TXTUSERNAME.Text = "administrator"
$= $FORM.MsgBox("You are not allowed to reset this password.", "Username invalid")
else
IF $TXTUSERNAME.Text = "rf.admin"
$= $FORM.MsgBox("You are not allowed to reset this password.", "Username invalid")
else
IF $TXTUSERNAME.Text = "tr.admin"
$= $FORM.MsgBox("You are not allowed to reset this password.", "Username invalid")
$TXTUSERNAME.Text = $STRUSERNAME
EXIT Sub
ELSE
$STRUSERNAME = $TXTUSERNAME.Text
ENDIF
$WAIT.Show
$STRUSERPATH = "WinNT://dcserve1/$STRUSERNAME,User"
$STRUSERPATH2 = "WinNT://dcserve2/$STRUSERNAME,User"
$USERACCOUNT = GetObject($STRUSERPATH)
IF Not $USERACCOUNT
; User does not exist
$= $FORM.MsgBox("A user called (" + $TXTUSERNAME.Text + ") does not exist.", "Username invalid")
ELSE
; User exists so bind to it
$USERACCOUNT.GetInfo
$CMDRESET_PASSWORD.Enabled = 1 ; Enable the reset password button
$CMDFINDUSER.Enabled = 0 ; Disable the finduser button
IF $USERACCOUNT.IsAccountLocked

$CMDUNLOCK.Enabled = 1 ; Enable the unlock button
$CMDRESET_PASSWORD.Enabled = 0 ; disable the reset password button
ENDIF
ENDIF

$FORM.Refresh
$TXTUSERNAME.SetFocus

ENDFUNCTION

FUNCTION Unlock_Account()

$WAIT = CreateObject("Kixtart.Form") ; Create form called $WAIT
$WAIT.Caption = "One moment please..."
$WAIT.ScaleWidth = 400
$WAIT.ScaleHeight = 75
$WAIT.FontSize = 12
$WAIT.FontName = "Arial"
$WAIT.PrintXY(30,30,"Unlocking Account, one moment please...")
$WAIT.Center
$WAIT.Show
DIM $USERACCOUNT
; APPEND to $UNLOCKLOG
IF $LOGGING = 1
$USERNAME = $TXTUSERNAME.Text
$NUL=Open(3,$UNLOCKLOG,5)
$NUL=writeline (3,"@USERID,$USERNAME,@DATE,@TIME" + Chr(13) + Chr(10))
$NUL=CLOSE(3)
ENDIF
; Unlock the account
$USERACCOUNT = GetObject($STRUSERPATH)
$USERACCOUNT.GetInfo
$USERACCOUNT.IsAccountLocked = 0
$USERACCOUNT.SetInfo
$= $FORM.MsgBox("The user (" + $STRUSERNAME + ") has been unlocked.", "User enabled")
$WAIT = 0 ; close the form called $WAIT
$USERACCOUNT = 0
$FORM.Refresh
$CMDEXIT.SetFocus
$CMDUNLOCK.Enabled = 0 ; Disable the unlock button
reset_password()

ENDFUNCTION

FUNCTION Reset_Password()

$WAIT = CreateObject("Kixtart.Form") ; Create form called $WAIT
$WAIT.Caption = "One moment please..."
$WAIT.ScaleWidth = 400
$WAIT.ScaleHeight = 75
$WAIT.FontSize = 12
$WAIT.FontName = "Arial"
$WAIT.PrintXY(30,30,"Resetting Password, one moment please...")
$WAIT.Center
$WAIT.Show
DIM $USERACCOUNT
; APPEND to $PASSWORDLOG
IF $LOGGING = 1
$USERNAME = $TXTUSERNAME.Text
$NUL=Open(4,$PASSWORDLOG,5)
$NUL=writeline (4,"@USERID,$USERNAME,@DATE,@TIME" + Chr(13) + Chr(10))
$NUL=CLOSE(4)
ENDIF
; Reset the pasword on the account
$USERACCOUNT = GetObject($STRUSERPATH)
$USERACCOUNT.GetInfo
$USERACCOUNT.setpassword("$PASSWORD")
$USERACCOUNT.put("PasswordExpired", 1)
$USERACCOUNT.setinfo
$USERACCOUNT = GetObject($STRUSERPATH2)
$USERACCOUNT.GetInfo
$USERACCOUNT.setpassword("$PASSWORD")
$USERACCOUNT.put("PasswordExpired", 1)
$USERACCOUNT.setinfo
$= $FORM.MsgBox("The password for user (" + $STRUSERNAME + ") has been Reset to aa123456.", "Password Reset")
$WAIT = 0 ; close the form called $WAIT
$USERACCOUNT = 0
$FORM.Refresh
$CMDEXIT.SetFocus
$CMDRESET_PASSWORD.Enabled = 0 ; Disable the reset password button
$FORM.Refresh

ENDFUNCTION




LonkeroAdministrator
(KiX Master Guru)
2002-08-21 04:51 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

yeah...
$USERACCOUNT.put("PasswordExpired", 1)

will not work on non-expiring passwords.
if you have those (oll in our net are) you will need to set the "user must change password" flag.


Bonji
(Starting to like KiXtart)
2002-08-21 05:23 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

I'm creating my script for a Windows 2000 domain and when I set an account where the password never expires to User must change password, then it basically is ignoring the change password setting and leaves it disabled. I will address the issue in my code, however I'm not aware of any situation where an account is set to not expire and you can have the User must change password enabled. Is this correct? Am I missing something?

Thanks,
Ben
http://www.rgcweb.org:90


LonkeroAdministrator
(KiX Master Guru)
2002-08-21 05:48 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

yeah, you are correct...
silly me.


Bonji
(Starting to like KiXtart)
2002-08-21 07:31 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Pete,

I will probably keep that feature in for myself (keep the safer setting the default action). However, to remove that feature you just need to delete/comment out the following 3 lines in the Function cmdSetPassword_Click()

$adsUser.PasswordExpired = 1
$adsUser.SetInfo
chkPasswordExpired.Value = 1

I may add this as an Option to be set after starting the script through an Options button on the form. I'll wait until I have one or two more options like this to set.

Thanks,
Ben
http://www.rgcweb.org:90 - User Manager Script


MCA
(KiX Supporter)
2002-11-15 02:27 AM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Update our site with the latest KixForms 2.9 release.
Also we put the link www.kixforms.freeuk.com on our
"Links to Favorite Sites".
greetings.

btw: the source of this tool is also reachable from the mainpage of our site. Simple click
on "Shawn Tassie".

[ 15. November 2002, 02:29: Message edited by: MCA ]


ShawnAdministrator
(KiX Supporter)
2002-11-15 05:20 AM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

M,

The link you have under my name points to a much out-of-date version of Kixforms. The latest is Version 2.1.2 Build 36 and its available at the Kixforms web site:

http://www.kixforms.freeuk.com/Assets/Files/KiXforms_212.zip

This link will obviously change over releases - not too sure how you want to deal that one out ... and big thanks for hosting this stuff on your web site ! [Wink]

-Shawn


MCA
(KiX Supporter)
2002-11-15 01:48 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Dear Shawn,

Thanks for your feedback. We will put the latest one on our site.
The problem with changing filenames isn't so big. We point to the download page.
greetings.

btw: we suggest to modify the link on first reaction. Now it points to the old release,
which is out of date.

[ 15. November 2002, 13:53: Message edited by: MCA ]


ShawnAdministrator
(KiX Supporter)
2002-11-15 02:06 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Ok - can someone explain why MCA has four stars and not five ? I could have sworn that he had five stars at one time !!! MCA has like 33 votes and four stars ... sup with that ? For any regulars that haven't done so already, please correct this grievous oversight.

LonkeroAdministrator
(KiX Master Guru)
2002-11-15 02:22 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

heh [Smile]
it was 5 stars when he had 32 votes...
(before today)


ShawnAdministrator
(KiX Supporter)
2002-11-15 02:31 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Thats what I thought - I thought I was seeing things !!! This scares me little bit.

Kdyer
(KiX Supporter)
2002-11-15 02:31 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Ben,

Little concerned about the WTS Section of it..

In Active Directory, you can assign a drive to the user's homedir (we typically) use H:.. This should follow suit.

Thanks,

Kent


MCA
(KiX Supporter)
2002-11-15 02:35 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Shawn,

With the feedback from Infopop it shouldn't be possible, but now we see indeed a
download of its value.
Indeed with 32 votes we had 5 stars. With 4 stars we will sleep also very well.
greetings.


ShawnAdministrator
(KiX Supporter)
2002-11-15 02:43 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Well, Im hoping one of the regulars can give you an upload of its value. What bugs is that this happened in the first place. And that we (as regulars) have tried to give other deserving four-star members a boost - but with little effect ! argghhh !

-Shawn


Chris S.
(MM club member)
2002-11-15 03:11 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

I tried, but alas, it didn't seem to do the trick.

LonkeroAdministrator
(KiX Master Guru)
2002-11-15 03:13 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

yep, it's weird.
dude who has over 30 votes and 5 stars gets ranked 4 after someone somewhere votes him lower.

and then someone else with 5 stars tries the same, no difference [Eek!] [Mad] [Eek!]


Les
(KiX Master)
2002-11-15 03:18 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

There is a lag time with the rating system. The results are not instant. I observed this with members that had no votes and I gave them a rating.

JochenAdministrator
(KiX Supporter)
2002-11-15 03:19 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Would do, but already voted [Frown]

Kdyer
(KiX Supporter)
2002-11-15 04:56 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Please excuse my previous post. I noticed that can be configured in the INI file.

Getting a weird error when I try to search for myself, for example:
quote:

Script error: array reference out of bounds!
$Group2Array[$Group2CNT]=$Group.Name

It does not seem to matter if I put in the userid or search and then select one.

Thanks!

Kent


Bonji
(Starting to like KiXtart)
2002-11-15 05:55 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Kent,

Are you saying you're not concerned with the WTS settings and would rather see the standard profile and home folder settings? We don't use the standard settings, but I think it would be good for me to include them. My priority was the Terminal Server settings since I needed someone in our company to be able to set those without going through the AD tool on the server. I'll put it on my to-do list for the tool.

[EDIT]
Kent, just noticed your post above mine was regarding your other post to me [Smile] . The drive letter can be set through the Options button (is maintained in the INI file). And the error you hit is probably due to a bad programming technique I've used since I couldn't quickly find a better way to do it (only time I had to do this in the script [Wink] ). I'm guessing you have more then 200 groups defined in your organization. If this is so then that is why you are hitting the problem. You need to change the value of the variable $MaxGroups to something higher then the total number of groups. The reason for this is that I have to create an array without knowing what size it needs to be later so I just set it to the value of $MaxGroups. Once the array is filled with data, it is resized down. Let me know if changing that variable doesn't work.

-If anyone can give me a proper way to address the above problem I would appreciate it. Basically I need to fill an array with a list without knowing the total number of items in the list until I reach the end of the data stream. I could probably run through the list once while maintaining a counter and then define the array and process the list again to fill the array. I'll make it work like this if there are no suggestions on a better way to do it.

Shawn: While I'm thinking about it...can a menu be included in a form such as 'FILE EDIT VIEW HELP'. Also what about tabs such as Display properties on Windows. Thanks.

-Ben
http://www.rgcweb.org/kix

[ 15. November 2002, 18:22: Message edited by: Ben Dulaney ]


ShawnAdministrator
(KiX Supporter)
2002-11-15 06:31 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Menus and MenuItems are slated for build 38 (the next build after the next release) ... Tabs were slated for build 40 because I wanted to finish-off the RichEdit (RichTextBox) control. So I would build 40 for that ...

The dynamic array thingy can be supported using the REDIM PRESERVE algorithm, try a BBS search for that puppy. Sure you will get some samples posted here very shortly [Wink]


Kdyer
(KiX Supporter)
2002-11-15 06:37 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Ben..

This stuff is so sweet..

I have a pretty good vested interst in this too.

I want to do the following..

When creating or updating a user when the WTS properties are added/changed, it adds in:
  • The User info
  • Checks for the profile and homedir
  • If the homedir does not exist, add the appropriate security to it.
  • The security perms for a folder is something that Shawn, Ceej, and I bounced around about year ago. [Big Grin]
Anyway, here is the code that I have modified..
What I intend to do is to either read in an excel spreadsheet or have it look for a specific domain user group and apply the perms to it. Additionally, we are migrating users (again).. So, these shares will need to be updated with the users on the new domain.

'Nuff rambling, here goes (yes, it is vb code) and we have a port-over to KiX too.
code:
'Use the wtsapi32.dll from VBS

' VB Constant declarations for WTS_CONFIG_CLASS
Const WTSUserConfigInitialProgram = &H0 ' string
Const WTSUserConfigWorkingDirectory = &H1 ' string
Const WTSUserConfigfInheritInitialProgram = &H2 ' DWORD
Const WTSUserConfigfAllowLogonTerminalServer = &H3 ' DWORD

' Timeout settings
Const WTSUserConfigTimeoutSettingsConnections = &H4 ' DWORD
Const WTSUserConfigTimeoutSettingsDisconnections = &H5 ' DWORD
Const WTSUserConfigTimeoutSettingsIdle = &H6 ' DWORD

' Client device settings
Const WTSUserConfigfDeviceClientDrives = &H7 ' DWORD
Const WTSUserConfigfDeviceClientPrinters = &H8 ' DWORD
Const WTSUserConfigfDeviceClientDefaultPrinter = &H9 ' DWORD

' Connection settings
Const WTSUserConfigBrokenTimeoutSettings = &HA ' DWORD
Const WTSUserConfigReconnectSettings = &HB ' DWORD

' Modem settings
Const WTSUserConfigModemCallbackSettings = &HC ' DWORD
Const WTSUserConfigModemCallbackPhoneNumber = &HD ' string

' Shadow settings
Const WTSUserConfigShadowingSettings = &HE ' DWORD

' User Profile settings
Const WTSUserConfigTerminalServerProfilePath = &HF ' string

' Terminal Server home directory
Const WTSUserConfigTerminalServerHomeDir = &H10 ' string
Const WTSUserConfigTerminalServerHomeDirDrive = &H11 ' string
Const WTSUserConfigfTerminalServerRemoteHomeDir = &H12 ' DWORD

'*************************************************************************
'*************************************************************************
Dim TSCFG

Set TSCFG= CreateObject("UserConfig.TSUserConfig")
Set oFs = CreateObject("Scripting.FileSystemObject")

' -- Grab the current domain you are running this script from
Set WshNetwork = WScript.CreateObject("WScript.Network")
TSCFG.Domain = WshNetwork.UserDomain
' -- If you want to manually set this, uncomment the next line and comment the previous two
'TSCFG.Domain = "MYDOMAIN"
'TSCFG.Domain = InputBox("Type The Domain name")

' -- Set the server where the shares reside
ShareServer = "SHARESERVER"

Debugger = "_No" 'If you want to see visual results, set this to be "_Yes"

TSCFG.UserName = InputBox("Type a User Name")

If TSCFG.UserName = "" Then
WScript.Echo "No UserID input provided. Stopping script now."
WScript.Quit (1)
End If

'We need to check and if need be create some folders for this user..
' Capture the name of the server are you adding the share to
TextShare = "\\" & ShareServer & "\D" & Chr(36)

' Setting the user$ variable - jdoe$ - Hidden shares don't show when browsing to a server
TextUserN = TSCFG.UserName & Chr(36)

' Setting the user1$ variable - jdoe1$ - Hidden shares don't show when browsing to a server
' Why are we using a jdoe1$ ?? This server has other shared drives for local Corporate User too.
TextUserNM = TSCFG.UserName & "1" & Chr(36) ' Created for home_dir

' Path for user folders
Homedir = TextShare & "\Citrix_Homedir"
Profiles = TextShare & "\Citrix_Profiles"

' Now let's create a variable to work with - \\SERVER\users\jdoe
' Directory to save
UserProfileDir = Profiles & "\" & TSCFG.UserName

' Check existence for folder
If Debugger = "_Yes" Then
If oFs.FolderExists(UserProfileDir) Then
WScript.Echo "The citrix profiles folder " & UserProfileDir & " already exists."
end if
end if

UserHomeDir = Homedir & "\" & TSCFG.UserName

' Check existence for folder
If Debugger = "_Yes" Then
If oFs.FolderExists(UserHomeDir) Then
WScript.Echo "The citrix Home_dir folder " & UserHomeDir & vbcrlf & " already exists and we are continuing."
end if
end if

' Create folder Profiles
If Not oFs.FolderExists(UserHomeDir) Then oFs.CreateFolder UserHomeDir

If Not oFs.FolderExists(UserProfileDir) Then oFs.CreateFolder UserProfileDir

' Create share
Set FservObj = GetObject("WinNT://" & ShareServer & "/lanmanserver")

If oFs.FolderExists("\\" & ShareServer & "\" & TextUserNM) Then
If Debugger = "_Yes" Then
WScript.Echo "The share \\" & ShareServer & "\" & TextUserNM & " already exists." & vbcrlf & " Continuing..."
end if
else
' Create the share for the server jdoe1$
set newshare = FservObj.create("fileshare",TextUserNM)
' Set the path for the share on the server - D:\Users
newshare.path = "D:\Citrix_Homedir\" & TSCFG.UserName
newshare.setinfo
WScript.Echo "The folders for " & TSCFG.UserName & " and share have been created."
end if


'-- Query the information for debugging - uncomment the next three lines to see this
'MsgBox TSCFG.QueryUserConfig(WTSUserConfigTerminalServerProfilePath)
'MsgBox TSCFG.QueryUserConfig(WTSUserConfigTerminalServerHomeDir)
'MsgBox TSCFG.QueryUserConfig(WTSUserConfigTerminalServerHomeDirDrive)

'-- Set some information
TSCFG.SetUserConfig WTSUserConfigfAllowLogonTerminalServer, 1
TSCFG.SetUserConfig WTSUserConfigTerminalServerProfilePath , "\\" & ShareServer & "\CITRIX_PROFILES\" & TSCFG.UserName
TSCFG.SetUserConfig WTSUserConfigTerminalServerHomeDirDrive , "H:"
TSCFG.SetUserConfig WTSUserConfigTerminalServerHomeDir , "\\" & ShareServer & "\" & TSCFG.UserName & "1" & chr(36)

WScript.Echo "The User Profile and Home Drive Server have been set for " & vbcrlf & TSCFG.UserName & vbcrlf & " and may take up to an hour to show up."

l = 0
'*** show all settings - documentation; see below!
'For x = 0 To 18
' MsgBox "setting " & x & " = " & TSCFG.QueryUserConfig(x)
'Next

''' --- Example Code and settings you can use..

'*** change a few settings:
'TSCFG.SetUserConfig WTSUserConfigWorkingDirectory , "c:\workdir"
'TSCFG.SetUserConfig WTSUserConfigInitialProgram , "startup.exe"

'*************************************************************************
'*************************************************************************


'*** http://msdn.microsoft.com/library/default.asp?url=/library/en-us/termserv/tsref_9z76.asp

'WTSUserConfigInitialProgram
'A null-terminated string containing the path of the initial program that Terminal Services
'runs when the user logs on.
'If the WTSUserConfigfInheritInitialProgram value is 1, the initial program can be any
'program specified by the client.

'WTSUserConfigfInheritInitialProgram
'WTSUserConfigfInheritInitialProgram value is 1, the initial program can be any program
'specified by the client.

'WTSUserConfigWorkingDirectory
'A null-terminated string containing the path of the working directory for the initial
'program.
'WTSUserConfigfInheritInitialProgram
'A value that indicates whether the client can specify the initial program. Value Meaning
'0 The client cannot specify the initial program. The WTSUserConfigInitialProgram string
'indicates the initial program. If you specify a user's initial program, that's the only
'program they can run; terminal server logs off the user when the user exits that program.
'1 The client can specify the initial program.


'WTSUserConfigfAllowLogonTerminalServer
'A value that indicates whether the user account is permitted to log on to a terminal server.
'Value Meaning
'0 The user cannot logon.
'1 The user can logon.


'WTSUserConfigTimeoutSettingsConnections
'A DWORD value that specifies the maximum connection duration, in milliseconds. One minute
'before the connection timeout interval expires, the user is notified of the pending
'disconnection. The user's session is disconnected or terminated depending on the
'WTSUserConfigBrokenTimeoutSettings value. Every time the user logs on, the timer is reset.
'A value of zero indicates the connection timer is disabled.
'WTSUserConfigTimeoutSettingsDisconnections
'A DWORD value that specifies the maximum duration, in milliseconds, that a terminal
'server retains a disconnected session before the logon is terminated. A value of zero
'indicates the disconnection timer is disabled.
'WTSUserConfigTimeoutSettingsIdle
'A DWORD value that specifies the maximum idle time, in milliseconds. If there is no
'keyboard or mouse activity for the specified interval, the user's session is disconnected
'or terminated depending on the WTSUserConfigBrokenTimeoutSettings value. A value of zero
'indicates the idle timer is disabled.
'WTSUserConfigfDeviceClientDrives
'Citrix ICA clients: A value that indicates whether the terminal server automatically
'reestablishes client drive mappings at logon. Value Meaning
'0 The server does not automatically connect to previously mapped client drives.
'1 The server automatically connects to previously mapped client drives at logon.


'WTSUserConfigfDeviceClientPrinters
'RDP 5.0 clients and Citrix ICA clients: A value that indicates whether the terminal server
'automatically reestablishes client printer mappings at logon. Value Meaning
'0 The server does not automatically connect to previously mapped client printers.
'1 The server automatically connects to previously mapped client printers at logon.


'WTSUserConfigfDeviceClientDefaultPrinter
'RDP 5.0 clients and Citrix ICA clients: A value that indicates whether the client printer
'is the default printer. Value Meaning
'0 The client printer is not the default printer.
'1 The client printer is the default printer.


'WTSUserConfigBrokenTimeoutSettings
'A value that indicates what happens when the connection or idle timers expire or when a
'connection is lost due to a connection error. Value Meaning
'0 The session is disconnected.
'1 The session is terminated.


'WTSUserConfigReconnectSettings
'A value that indicates how a disconnected session for this user can be reconnected.
'Value Meaning
'0 The user can log on to any client computer to reconnect to a disconnected session.
'Note that sessions started at clients other than the system console cannot be connected
'to the system console, and sessions started at the system console cannot be disconnected.
'1 The user can reconnect to a disconnected session by logging on to the client computer
'used to establish the disconnected session. If the user logs on from a different client
'computer, the user gets a new logon session.


'WTSUserConfigModemCallbackSettings
'Citrix ICA clients: A value that indicates the configuration for dialup connections in which
'the terminal server hangs up and then calls back the client to establish the connection.
'Value Meaning
'0 Callback connections are disabled.
'1 The server prompts the user to enter a phone number and calls the user back at that phone
'number. You can use the WTSUserConfigModemCallbackPhoneNumber value to specify a default
'phone number.
'2 The server automatically calls the user back at the phone number specified by the
'WTSUserConfigModemCallbackPhoneNumber value.


'WTSUserConfigModemCallbackPhoneNumber
'Citrix ICA clients: A null-terminated string containing the phone number to use for callback
'connections.
'WTSUserConfigShadowingSettings
'RDP 5.0 clients and Citrix ICA clients: A value that indicates whether the user session can
'be shadowed. Shadowing allows a user to remotely monitor the on-screen operations of another user.
'Value Meaning
'0 Disable
'1 Enable input, notify
'2 Enable input, no notify
'3 Enable no input, notify
'4 Enable no input, no notify


'WTSUserConfigTerminalServerProfilePath
'A null-terminated string containing the path of the user's profile for terminal server logon.
'The directory the path identifies must be created manually, and must exist prior to the logon.
'WTSSetUserConfig will not create the directory if it does not already exist.
'WTSUserConfigTerminalServerHomeDir
'A null-terminated string containing the path of the user's home directory for terminal server
'logon. This string can specify a local path or a UNC path (\\machine\share\path). See
'WTSUserConfigfTerminalServerRemoteHomeDir.
'WTSUserConfigTerminalServerHomeDirDrive
'A null-terminated string containing a drive specification (a drive letter followed by a colon)
'to which the UNC path specified in the WTSUserConfigTerminalServerHomeDir string is mapped.
'See WTSUserConfigfTerminalServerRemoteHomeDir.
'WTSUserConfigfTerminalServerRemoteHomeDir
'A value that indicates whether the user's home directory for terminal server logon is a local
'path or a mapped drive letter. Note that this value cannot be used with WTSSetUserConfig.
'Value Meaning
'0 The WTSUserConfigTerminalServerHomeDir string contains the local path of the user's terminal
'server logon home directory.
'1 The WTSUserConfigTerminalServerHomeDir string contains the UNC path of the user's terminal
'server logon home directory, and the WTSUserConfigTerminalServerHomeDirDrive string contains
'a drive letter to which the UNC path is mapped.



Bonji
(Starting to like KiXtart)
2002-11-15 07:14 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Shawn: I already use REDIM to resize my array down, however I was wondering if there was a better way to declare an array without knowing the total of the list of items. After pondering this for a bit, I don't think there is a better way to do it as you can't set an array to the correct size without knowing what the correct size is to begin with. Thanks for your input though! I'm looking forward to the next builds of Kixforms!

Kent: Am I correct in guessing that you have taken the .dll and changed the code to suit your needs? Is this the same .dll I use for my tool?

-Ben
http://www.rgcweb.org/kix


Kdyer
(KiX Supporter)
2002-11-15 07:25 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Ben,

To answer your question, I have not modified the DLL, but the sample code (the VBS file) that came with it.

We need to give credit where credit is due..

Ceej (or CJ) was the one who came up with this via a NewsGroup (as I remember)..

Started to dig into this and found that the author - bambi@crackdealer.com (no, this is not a typo) was the one who wrote this and did some more investigation and found it over on http://planetsourcecode.com and specifically -

[URL=

Terminal Server UserConfig

So, downloaded the files, sparked up Visual Studio and compiled the DLL.

Thanks!

Kent

[ 15. November 2002, 19:26: Message edited by: kdyer ]


cj
(MM club member)
2002-11-23 03:23 AM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

.NET now supports functions to modify the Terminal Server settings, so TSUserConfig's days are numbered.

I still use TSUC though.

cj


Les
(KiX Master)
2002-11-23 03:27 AM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Welcome back ceej... been over 3 months.

Bonji
(Starting to like KiXtart)
2002-11-25 01:45 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Will the TSUC dll still manipulate the same settings on a .NET server? I would like my tool to work on 2000 and .NET, however we will not be upgrading to .NET ever (most likely) since we just upgraded to 2000. The next time we upgrade it will probably be to the version after .NET.

-Ben
http://www.rgcweb.org/kix


Kdyer
(KiX Supporter)
2002-11-26 05:01 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Ben,

Getting the following err message:
quote:

Script error: array reference out of bounds!
$Group2Array[$Group2CNT]=$Group.Name

If I comment out:
code:
		IF $Group.Class = "Group"
;$Group2Array[$Group2CNT]=$Group.Name
$Group2CNT = $Group2CNT + 1
ENDIF

It appears to work but the available groups in the Network User Manager do not appear to populate.

Kent


ShawnAdministrator
(KiX Supporter)
2002-11-26 07:36 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Kent, think we are supposed to change this variable:

$MaxGroups

if the number of groups the in the domain blows
past the array, or at least wasn't Ben hinting
at implementing one of those dynarrays to handle
this ... does your version have this feature or
is it an older one ?

-Shawn

[ 26. November 2002, 19:37: Message edited by: Shawn ]


Bonji
(Starting to like KiXtart)
2002-11-26 08:38 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Yeah, the $MaxGroups has to be changed, however I meant to have that changed already where that value no longer needs to be set. I hope to have the code changed today (before I leave on a turkey trip). Will update when done...

[EDIT]
That was easier then I thought. I've updated the code so that the variable will no longer need to be set. It now enumerates all items and keeps a count of items then sets $MaxGroups to the counters final value.

-Ben
http://www.rgcweb.org/kix

[ 26. November 2002, 20:47: Message edited by: Ben Dulaney ]


Kdyer
(KiX Supporter)
2002-11-26 08:47 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Ok moved it to 1600 Groups and works fine..

Kent


BogdanSUA
(Fresh Scripter)
2004-01-08 12:41 AM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

I tried to use the Network Manager script as posted at http://www.rgcweb.org/kix/

I made sure to download and properly install all the requirements.

But I keep getting an error stating
Script error: missing ENDFUNCTION for [getgroups1]!

So I took out the Getgroups1 section from the script. Now the form pops up. Am I doing something wrong? Is anyone else having this problem?

Regards,

BogdanSUA

FYI: I am trying this on a WinXP SP1 box on a Win2003 domain.


ShawnAdministrator
(KiX Supporter)
2004-01-08 12:52 AM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Was just checking out the latest code and spotted this line:

Code:

$QueryString = " 1
$TstBit = $TstBit / 2
LOOP



Looks like an unclosed quote to me.

-Shawn


BogdanSUA
(Fresh Scripter)
2004-01-09 06:56 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Yup that was it. I closed the quote and it works now.

Thanks,

BogdanSUA


Bonji
(Starting to like KiXtart)
2004-01-20 04:11 PM
Re: Kixforms: Manage User Details - Here`s MUD in your eye !

Hey guys. First off I must apologize for not having my latest version of the network manager tool posted. That has now been remedied. I have added a few features and bug fixes, however please let me know if you have any problems with the code as I am not as close to it as I used to be. I hope to have a page up for sending feedback on the code directly to me so I can be timely with responding to any issues.

That being said, I'm confused as to the problem reported by BogdanUSA. I cannot find this problem in my production code or in the code on my webpage. Is there a different version floating around now or am I missing something?

Thanks for keeping me on the straight and narrow.

-Ben
http://www.rgcweb.org/kix