+ Post New Thread
Results 1 to 12 of 12
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 ...
  1. #1

    SpuffMonkey's Avatar
    Join Date
    Jul 2005
    Posts
    2,224
    Thank Post
    54
    Thanked 276 Times in 184 Posts
    Rep Power
    133

    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...?

  2. #2
    Mcshammer_dj's Avatar
    Join Date
    Feb 2007
    Location
    Portsmouth
    Posts
    921
    Thank Post
    35
    Thanked 160 Times in 129 Posts
    Rep Power
    56
    change the login times for all users

  3. #3
    PEO
    PEO is offline
    PEO's Avatar
    Join Date
    Oct 2007
    Posts
    2,093
    Thank Post
    457
    Thanked 150 Times in 95 Posts
    Rep Power
    71
    select all users - right click and disable

  4. #4

    Join Date
    Mar 2008
    Location
    Surrey
    Posts
    2,160
    Thank Post
    98
    Thanked 318 Times in 260 Posts
    Blog Entries
    4
    Rep Power
    111
    Stop the net logon service?

  5. #5

    SpuffMonkey's Avatar
    Join Date
    Jul 2005
    Posts
    2,224
    Thank Post
    54
    Thanked 276 Times in 184 Posts
    Rep Power
    133
    Quote Originally Posted by PEO View Post
    select all users - right click and disable
    Yeah - but I've 1500 users spread over a zillion AD areas (small exaggeration..) *sigh*

  6. #6

    SpuffMonkey's Avatar
    Join Date
    Jul 2005
    Posts
    2,224
    Thank Post
    54
    Thanked 276 Times in 184 Posts
    Rep Power
    133
    Quote Originally Posted by jamesb View Post
    Stop the net logon service?
    Yebbut nobbut yebbut a couple of us need to be logged on to do the work..

  7. #7

    Join Date
    May 2009
    Location
    England
    Posts
    264
    Thank Post
    58
    Thanked 36 Times in 35 Posts
    Rep Power
    19
    Turn off all switches to areas you dont need to log in?

  8. #8


    Join Date
    Mar 2009
    Location
    Leeds
    Posts
    6,506
    Thank Post
    227
    Thanked 848 Times in 727 Posts
    Rep Power
    287
    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

  9. #9

    Join Date
    Aug 2005
    Location
    London
    Posts
    3,154
    Thank Post
    114
    Thanked 527 Times in 450 Posts
    Blog Entries
    2
    Rep Power
    123
    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.

  10. Thanks to srochford from:

    kmount (31st July 2009)

  11. #10


    Join Date
    Feb 2007
    Location
    Northamptonshire
    Posts
    4,686
    Thank Post
    352
    Thanked 794 Times in 714 Posts
    Rep Power
    346
    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.

  12. #11

    SpuffMonkey's Avatar
    Join Date
    Jul 2005
    Posts
    2,224
    Thank Post
    54
    Thanked 276 Times in 184 Posts
    Rep Power
    133
    Steve - you are my scripting God! And nice one Kim - I like that too - cheers guys - I knew there'd be some clever suggestions!

  13. #12
    IrritableTech's Avatar
    Join Date
    Nov 2007
    Location
    West Yorkshire
    Posts
    791
    Thank Post
    83
    Thanked 171 Times in 140 Posts
    Rep Power
    64
    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:
+ Post New Thread

Similar Threads

  1. Log logons
    By FN-GM in forum Scripts
    Replies: 18
    Last Post: 29th April 2008, 12:00 AM
  2. Concurrent logons
    By mrforgetful in forum Wireless Networks
    Replies: 7
    Last Post: 28th February 2008, 05:33 PM
  3. Restricting Logons
    By Espada in forum Windows
    Replies: 2
    Last Post: 6th December 2007, 05:51 PM
  4. Really slow logons
    By dezt in forum Wireless Networks
    Replies: 8
    Last Post: 28th August 2007, 08:43 AM
  5. Slow Logons
    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
  •