SpuffMonkey Posted July 30, 2009 Posted July 30, 2009 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...?
SpuffMonkey Posted July 30, 2009 Author Posted July 30, 2009 select all users - right click and disable Yeah - but I've 1500 users spread over a zillion AD areas (small exaggeration..) *sigh*
SpuffMonkey Posted July 30, 2009 Author Posted July 30, 2009 Stop the net logon service? Yebbut nobbut yebbut a couple of us need to be logged on to do the work..
Potato-Peeler Posted July 30, 2009 Posted July 30, 2009 Turn off all switches to areas you dont need to log in?
sted Posted July 30, 2009 Posted July 30, 2009 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
srochford Posted July 30, 2009 Posted July 30, 2009 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. 1
kmount Posted July 30, 2009 Posted July 30, 2009 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.
SpuffMonkey Posted July 31, 2009 Author Posted July 31, 2009 Steve - you are my scripting God! And nice one Kim - I like that too - cheers guys - I knew there'd be some clever suggestions!
IrritableTech Posted July 31, 2009 Posted July 31, 2009 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now