Windows Server 2000/2003 Thread, Stopping logons in Technical; Hi - we're doing some serious work on our storage SANs next week - so I need to stop nearly ...
-
30th July 2009, 10:39 AM #1 Stopping logons
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...?
-
-
IDG Tech News
-
30th July 2009, 10:45 AM #2 change the login times for all users
-
-
30th July 2009, 10:49 AM #3 select all users - right click and disable
-
-
30th July 2009, 10:50 AM #4 Stop the net logon service?
-
-
30th July 2009, 03:14 PM #5 
Originally Posted by
PEO
select all users - right click and disable
Yeah - but I've 1500 users spread over a zillion AD areas (small exaggeration..) *sigh*
-
-
30th July 2009, 03:14 PM #6 
Originally Posted by
jamesb
Stop the net logon service?
Yebbut nobbut yebbut a couple of us need to be logged on to do the work..
-
-
30th July 2009, 03:14 PM #7 Turn off all switches to areas you dont need to log in?
-
-
30th July 2009, 03:20 PM #8 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
-
-
30th July 2009, 03:51 PM #9 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 Script to populate AD fields with a bit of modification:
Code:
Set oRoot=getobject("LDAP://rootdse")
sDomain=oRoot.get("defaultNamingContext")
Set oConn = CreateObject("ADODB.Connection")
oConn.Provider = "ADsDSOOBJECT"
oconn.Open
sQuery = "<LDAP://" & sDomain & ">;(&(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"))
if instr(sAccount,"|administrator|steve|andy|bryan|")=0 then
Set oUser=getobject(sUser)
oUser.AccountDisabled=true
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 to srochford from:
-
30th July 2009, 03:55 PM #10 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.
-
-
31st July 2009, 09:33 AM #11 Steve - you are my scripting God! And nice one Kim - I like that too - cheers guys - I knew there'd be some clever suggestions!
-
-
31st July 2009, 09:54 AM #12 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.
-
SHARE:
Similar Threads
-
By FN-GM in forum Scripts
Replies: 18
Last Post: 29th April 2008, 12:00 AM
-
By mrforgetful in forum Networks
Replies: 7
Last Post: 28th February 2008, 06:33 PM
-
By Espada in forum Windows
Replies: 2
Last Post: 6th December 2007, 06:51 PM
-
By dezt in forum Networks
Replies: 8
Last Post: 28th August 2007, 08:43 AM
-
By andyrite in forum Windows
Replies: 3
Last Post: 24th April 2007, 09:48 AM
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules