By David Wiseman (Administrator)Created 28 Jan 2006
My Rating:
Vote
Rating:
Not Rated
Views:4535
Downloads:24

Enable/Disable Account is sensitive and cannot be delegated

Language:  VBScript

Compatibility

Windows XP Unknown Windows 2003 Yes
Windows 2000 Unknown Windows NT Unknown
Vista Unknown Windows 2008 Unknown
Description

Change the "Account is sensitive and cannot be delegated" setting.

Code

Line Numbers: On  Off      Plain Text
const ADS_UF_ACCOUNT_SENSITIVE = &H100000

Dim objUser
'<<<< Bind to the user object using the distinguished name >>>>
set objUser = getobject("LDAP://cn=test.3,cn=users,dc=wisesoft,dc=co,dc=uk")

intUAC = objUser.Get("userAccountControl")

'<<<<< Enable Account is sensitive and cannot be delegated >>>>>
if  (intUAC AND ADS_UF_ACCOUNT_SENSITIVE)=0 Then
	objUser.put "userAccountControl",  intUAC XOR ADS_UF_ACCOUNT_SENSITIVE
	objUser.setinfo
end if

'<<<<< Disable Account is sensitive and cannot be delegated >>>>>
if intUAC and ADS_UF_ACCOUNT_SENSITIVE Then
	objUser.put "userAccountControl",  intUAC XOR ADS_UF_ACCOUNT_SENSITIVE
	objUser.setinfo
end if

 


Got a useful script? Click here to upload!


 

  Post Comment
Order By:  
User Comments
      
Be the first to post a comment!