locked
Command to modify logon workstations RRS feed

  • Question

  • Is there are a command line utility that will allow me to modify the workstations a domain user can log on to?

    Normally I'd do it through the MMC but I've got a long list of computers I need to add to a dozen service accounts and I don't fancy manually adding one computer at a time to each. I found this script http://blogcastrepository.com/blogs/mattbro/pages/1354.aspx which I think will achieve the goal but surely it doesn't have to be that complicated? Running a 2003 native domain.

    Cheers

    Wednesday, November 16, 2011 5:20 AM

Answers

  • To set a value for userWorkstations:

    strUserDN = "cn=TestUser,ou=Sales,dc=MyDomain,dc=com"
    Set objUser = GetObject("LDAP://" & strUserDN)
    strWorkstations = "Training01,Training02,Training03,Training04"
    objUser.userWorkstations = strWorkstations
    objUser.SetInfo

     


    If you found this post helpful, please give it a "Helpful" vote. If it answered your question, remember to mark it as an "Answer". This posting is provided "AS IS" with no warranties and confers no rights! Always test ANY suggestion in a test environment before implementing!
    • Marked as answer by Zaphod6969 Wednesday, November 16, 2011 5:53 AM
    Wednesday, November 16, 2011 5:42 AM

All replies

  • Refer below link this may be helpful:
    http://portal.sivarajan.com/2011/05/modify-log-on-to-userworkstations-user.html

    Regards,
    Sandesh Dubey.
    -------------------------------
    MCSE|MCSA:Messaging|MCTS|MCITP:Enterprise Adminitrator
    My Blog: http://sandeshdubey.wordpress.com
    This posting is provided AS IS with no warranties, and confers no rights.

    Wednesday, November 16, 2011 5:41 AM
  • To set a value for userWorkstations:

    strUserDN = "cn=TestUser,ou=Sales,dc=MyDomain,dc=com"
    Set objUser = GetObject("LDAP://" & strUserDN)
    strWorkstations = "Training01,Training02,Training03,Training04"
    objUser.userWorkstations = strWorkstations
    objUser.SetInfo

     


    If you found this post helpful, please give it a "Helpful" vote. If it answered your question, remember to mark it as an "Answer". This posting is provided "AS IS" with no warranties and confers no rights! Always test ANY suggestion in a test environment before implementing!
    • Marked as answer by Zaphod6969 Wednesday, November 16, 2011 5:53 AM
    Wednesday, November 16, 2011 5:42 AM