Petri IT Knowledgebase Forums
 

Petri.co.il forums Home Forums Start Page Forums Frequently Asked Questions FAQ Member List Members List
Go Back   Petri IT Knowledgebase Forums > Windows Scripting > General Scripting
Petri.co.il is happy to award auglan the title of Most Valuable Member !!!
Register Calendar Calendar Search Petri IT Knowledgebase Forums Search Todays Posts Today's Posts Mark Forums Read

Notices

Disable Active Directory user account

Disable Active Directory user account

this thread has 2 replies and has been viewed 12092 times

Closed Thread
 
Thread Tools Search this Thread Display Modes
  #1  
Old 16th November 2005, 15:00
Lucide Lucide is offline
Casual
Casual
 
 Join Date: Nov 2005
  6 month star 12 month star
 Posts: 3
 Reputation: Lucide is on a distinguished road (10)
Default Disable Active Directory user account

Hi everyone!

I am new to scripting but please bear up with me. I am trying to run the script below to disable a user account in Windows 2000 Server Active Directory.

Const ADS_UF_ACCOUNTDISABLE = 2

Set objUser = GetObject _
("LDAP://cn=myerken,ou=management,dc=fabrikam,dc=com")
intUAC = objUser.Get("userAccountControl")

objUser.Put "userAccountControl", intUAC OR ADS_UF_ACCOUNTDISABLE
objUser.SetInfo

When I run this code, I get the 8007202B error: A referral was returned from the server. Could anyone assist me with this please? I would highly appreciate it.
  #2  
Old 16th November 2005, 15:03
topper's Avatar
topper topper is offline
Member
Someone to look up to
 
 Join Date: Apr 2005
  6 month star 12 month star
 Location: Leeds, England.
 Posts: 741
 Reputation: topper is just really nicetopper is just really nicetopper is just really nicetopper is just really nice (356)
Default Re: Disable Active Directory user account

This maybe a daft question but you have changed the LDAP query to point to your own domain and not the MS test one from Script Center.

topper.
__________________
There are 10 types of people in this world, those who understand binary and those who do not.
  #3  
Old 17th November 2005, 16:30
Lucide Lucide is offline
Casual
Casual
 
 Join Date: Nov 2005
  6 month star 12 month star
 Posts: 3
 Reputation: Lucide is on a distinguished road (10)
Default Re: Disable Active Directory user account

Hi topper,

I certainly appreciate your hint. Actually, I never modified the script from Script Center--which is why I am not getting any good result.

The LDAP query should point to my domain. Again, thanx. I will try to play around with the LDAP line a bit.

Further hints on this, still much appreciated.
Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
User login problem ! sco1984 Windows 2000 Pro, XP Pro 5 5th September 2006 16:14
help on net user add netwarbler Active Directory 3 18th November 2005 22:27
Problems w/ unlock user account script in Active Directory Shane General Scripting 1 25th July 2005 23:29
Active Directory User Logon Name Change tech25 Active Directory 4 4th July 2005 09:14
reject mail if user in Active Directory pstacks Exchange 2000 / 2003 3 4th May 2005 18:48


All times are GMT +3. The time now is 11:49.

Steel Blue 3.5.4 vBulletin Style ©2006 vBEnhanced
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
 

Valid XHTML 1.0!   Valid CSS!

Copyright 2005 Daniel Petri