Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 04-22-2005, 08:35 AM   #1 (permalink)
Odoggy5
Code Monkey
 
Odoggy5's Avatar
 
Join Date: Aug 2003
Location: SF
Posts: 47
Odoggy5 is on a distinguished road
Send a message via AIM to Odoggy5
VB script

just starting messing with some scripts for AD wondering if somebody could help meout with this one. This script unchecks the password never expires value for a user, how can I do the opposite and put a check mark in that option?

Code:
CONST ADS_UF_DONT_EXPIRE_PASSWD = &h10000
Set objUser = GetObject _
 ("LDAP://cn=pos2000,ou=pos2000 users,dc=rtd02590,dc=local")
intUAC = objUser.Get("userAccountControl") 

If intUAC AND _
 ADS_UF_DONT_EXPIRE_PASSWD Then
 objUser.Put "userAccountControl", intUAC XOR _
  ADS_UF_DONT_EXPIRE_PASSWD
 objUser.SetInfo
End If
Odoggy5 is offline   Reply With Quote
Old 04-27-2005, 05:09 AM   #2 (permalink)
Oscar
Registered User
 
Join Date: Apr 2005
Posts: 1
Oscar is on a distinguished road
userAccountControl is an additive parameter, so it's made up of x + y + z to determine which permissions etc the user has. For example, if a user has a value of 512 (Normal), the value for "Password not required" is 32, so to set the account to not require a password, set the userAccountControl to 512+32=544
You can get a more comprehensive list of the codes from http://www.computerperformance.co.uk/ezine/ezine23b.htm
Oscar is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Executing a server script from PHP sde PHP 4 02-05-2005 12:12 PM
VB or C#, or something else Apodysophilia MS Technologies ( ASP, VB, C#, .NET ) 6 10-15-2004 10:48 AM
running a script at designated time tzarin PHP 5 05-12-2004 08:11 PM


All times are GMT -8. The time now is 08:39 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 RC8 ©2007, Crawlability, Inc.





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting