[THIN] Re: OT:Kix Unlocking accounts in a NT domain

  • From: "Schaefer, Jay" <JSchaefer@xxxxxxxxxxxxxxxxxx>
  • To: "'thin@xxxxxxxxxxxxx'" <thin@xxxxxxxxxxxxx>
  • Date: Thu, 13 Nov 2003 07:51:37 -0600

For us, it's part of our remote control /pc inventory program (written in
VB).  Here is the heart of the code.  Do a search on NetUserSetInfo for more
information.  Also can reset password with the same commands.


------------------------------------
   If (NetUserGetInfo(StrConv(strServerName, vbUnicode),
StrConv(strUserName, vbUnicode), 3, lpBuf) = NERR_Success) Then
       Call MoveMemory(ui3, ByVal lpBuf, Len(ui3))

       '       MsgBox GetStrFromPtrW(ui3.usri3_flags)
       lngFlags = ui3.usri3_flags
       
        blnIsNowDisabled = lngFlags And UF_LOCKOUT
        If (blnIsNowDisabled) Then
         MsgBox "Account is locked out"
         ui3.usri3_flags = lngFlags Xor UF_LOCKOUT
         If Len(Trim$(strServerName)) = 0 Then
            lngSvrName = 0&
         Else
            lngSvrName = StrPtr(strServerName)
         End If
        ' Convert the user name to a pointer
         If Len(Trim$(lngUserName)) = 0 Then
            Exit Function                     'Handle the error
         Else
            lngUserName = StrPtr(strUserName)
         End If
   
         lpBuf = VarPtr(ui3)
         lngRtn = NetUserSetInfo(lngSvrName, lngUserName, UserInfo1, lpBuf,
lngParmErr)
         If lngRtn = NERR_Success Then
            Call CopyMem(ui3, lpBuf, Len(ui3))
            MsgBox "Account Unlocked"
         Else
            If lngRtn = 5 Then
                MsgBox "You don't have rights to do this"
            Else
                MsgBox "Error Number: " & lngRtn
            End If
         End If
         
        Else
        
         MsgBox "Account is not locked out"
        End If
    
       Call NetApiBufferFree(ByVal lpBuf)
     End If

-------------------------------------------

J


-----Original Message-----
From: Greg.Watts@xxxxxxxxxxxxxx [mailto:Greg.Watts@xxxxxxxxxxxxxx]
Sent: Wednesday, November 12, 2003 11:13 AM
To: thin@xxxxxxxxxxxxx
Subject: [THIN] OT:Kix Unlocking accounts in a NT domain


Does someone know a kix script command or any utility that I can script out
a way of unlocking NT Domain accounts?

TIA!


Greg Watts
Wells Fargo
410.884.2157
********************************************************
This Week's Sponsor - RTO Software / TScale
What's keeping you from getting more from your terminal servers? Did you
know, in most cases, CPU Utilization IS NOT the single biggest
constraint to scaling up?! Get this free white paper to understand the
real constraints & how to overcome them. SAVE MONEY by scaling-up rather
than buying more servers.
http://www.rtosoft.com/Enter.asp?ID=147
**********************************************************
Useful Thin Client Computing Links are available at:
http://thethin.net/links.cfm
New! Online Thin Computing Magazine Site
http://www.OnDemandAccess.com

For Archives, to Unsubscribe, Subscribe or 
set Digest or Vacation mode use the below link:
http://thethin.net/citrixlist.cfm
********************************************************
This Week's Sponsor - RTO Software / TScale
What's keeping you from getting more from your terminal servers? Did you
know, in most cases, CPU Utilization IS NOT the single biggest
constraint to scaling up?! Get this free white paper to understand the
real constraints & how to overcome them. SAVE MONEY by scaling-up rather
than buying more servers.
http://www.rtosoft.com/Enter.asp?ID=147
**********************************************************
Useful Thin Client Computing Links are available at:
http://thethin.net/links.cfm
New! Online Thin Computing Magazine Site
http://www.OnDemandAccess.com

For Archives, to Unsubscribe, Subscribe or 
set Digest or Vacation mode use the below link:
http://thethin.net/citrixlist.cfm

Other related posts: