Register | Login
Sunday, July 20, 2008

Sections
  
About Us
  
Hosting Provided by Server Intellect
Partners
Downloads
  
 WWWCoder.com Resource Directory

ADSI: Disable / Enable an Account
9/24/2004 8:15:44 AM

Manage your domain, and active directory. This code snip disables and enables an account in the Windows domain.


' function to enable or disable the account of a user.
' accepts true or false to enable or disable an acccount.
Dim strDomain
Dim strUser

strDomain = "myDomain"
strUser = "Username"

Sub DisableEnableAccount(blnStatus)
On Error Resume Next
Set oUser = GetObject(strDomain & "/" & strUser)
oUser.AccountDisabled = blnStatus
oUser.SetInfo
Set oUser = Nothing
If Err <> 0 Then
strServerError = strServerError & "Status change failed!" & vbcrlf
End If
End Sub


Page Options:
format for printing  Format for Printer
email article  Email Page
add to your favorites   Add to Favorites
How would you rate the quality of this content?
Poor - - Excellent
Comments?
Overall Rating:
Comments Left:
Left on 11/7/2006 1:53:15 AM by Anonymous
Comments:
Left on 5/23/2006 12:07:22 PM by Anonymous
Comments: i need to know what the value of blnStatus is - is it 1 or True
No ratings available.
  

 Latest Articles
  

 Latest News
  

 

Spotlight
Syndication

 


 


Digg This
 


DotNetNuke Platinum Benefactor

  
 

 Terms Of Use | Privacy Statement
 Copyright 2008 - Santry Technology Solutions, Box 172, Girard, PA 16417, (814) 774-0970