+ 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,258
    Thank Post
    55
    Thanked 283 Times in 189 Posts
    Rep Power
    135

    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
    967
    Thank Post
    37
    Thanked 173 Times in 138 Posts
    Rep Power
    96
    change the login times for all users

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

  4. #4

    Join Date
    Mar 2008
    Location
    Surrey
    Posts
    2,217
    Thank Post
    116
    Thanked 332 Times in 274 Posts
    Blog Entries
    4
    Rep Power
    115
    Stop the net logon service?

  5. #5

    SpuffMonkey's Avatar
    Join Date
    Jul 2005
    Posts
    2,258
    Thank Post
    55
    Thanked 283 Times in 189 Posts
    Rep Power
    135
    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,258
    Thank Post
    55
    Thanked 283 Times in 189 Posts
    Rep Power
    135
    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
    20
    Turn off all switches to areas you dont need to log in?

  8. #8


    Join Date
    Mar 2009
    Location
    Leeds
    Posts
    6,814
    Thank Post
    231
    Thanked 888 Times in 763 Posts
    Rep Power
    301
    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,157
    Thank Post
    116
    Thanked 529 Times in 452 Posts
    Blog Entries
    2
    Rep Power
    124
    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,698
    Thank Post
    352
    Thanked 803 Times in 718 Posts
    Rep Power
    348
    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,258
    Thank Post
    55
    Thanked 283 Times in 189 Posts
    Rep Power
    135
    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
    850
    Thank Post
    99
    Thanked 197 Times in 161 Posts
    Rep Power
    70
    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
  •