Jump to content

Recommended Posts

Posted
Hi - we're doing some serious work on our storage SANs next week - so I need to stop nearly everyone logging in (w2k3 and XP) - anyone got a simple way to do this - normally I'd consider pulling the network plug - but I need a running network for some of the work - so I don't really want to have to manually alter 1500 user login details...?
Posted
at a guess all the users you need to block are staff/students and not admins couldnt you just create a group for them and then block that group
Posted

I always like the "select all the accounts and right click" type answers - I wouldn't have thought that there were many people here with an AD small enough for that to work :-)

 

You could use the script I posted the other day at http://www.edugeek.net/forums/scripts/39363-script-populate-ad-fields.html#post366407 with a bit of modification:

 

Set oRoot=getobject("LDAP://rootdse")
sDomain=oRoot.get("defaultNamingContext")
Set oConn = CreateObject("ADODB.Connection")
oConn.Provider = "ADsDSOOBJECT"
oconn.Open
sQuery = ";(&(objectClass=user)(objectcategory=person));ADsPath, sAMAccountName, displayname;subtree"
Set oRS = oConn.Execute(sQuery)
do While Not oRS.EOF
   sUser=oRS("ADSPath")
   sAccount=lcase(ors("sAMAccountName"))
  [color="Red"] if instr(sAccount,"|administrator|steve|andy|bryan|")=0 then[/color]     
     Set oUser=getobject(sUser)
     [color="Red"]oUser.AccountDisabled=true[/color]
     oUser.setinfo
   end if
   
 oRS.MoveNext
loop

 

key bits in red; first checks for accounts you want to keep active (usernames in lower case or it won't work!), second disables everything else.

 

When you're done, re-run the script but change the "true" to "false" and the accounts are re-enabled.

  • Thanks 1
Posted
Whilst I like Steve's solution there, for the right click disablers you could just search the domain for users, sort by type to get the groups out of the way, highlight all of the users, deselect the few you don't want to disable and then right click disable.
Posted

Search domain for Users, Contacts and Groups, leave the search field blank. Order by type. Select first user hold shift and select last user, right click and disable. Easy.

 

Sorry, didn't read Kims post. Move on now people.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...