Results 1 to 2 of 2

Thread: Help? Need beginners guide to getting usernames from a windows server

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2006
    Posts
    1

    Question Help? Need beginners guide to getting usernames from a windows server

    Hello,

    I am a beginner to VBScript and ASP and I am building a frontend for a license database and I having the following issues:

    I want to:
    Connect to a Windows Server 2003 box and copy the local user account names and local group names to variables.


    I have no idea how to go about connecting to the server and getting the user account and group names.

    Any help would be greatly appreciated!

    Thank you for your time!

  2. #2
    New Member MannyM's Avatar
    Join Date
    Jun 2006
    Posts
    11

    Cool Re: Help? Need beginners guide to getting usernames from a windows server

    Quick Tip:

    Here's the code to accomplish your task:

    Private Sub PullAllUsersFromDomain(strDomainName)
    Dim dcDomainController
    Set dcDomainController = GetObject("WinNT://" & strDomainName)
    dcDomainController.Filter = Array("User")

    For Each User In dcDomainController
    Response.Write User.Name
    Next
    End Sub

    Sub PullAllGroupsFromDomain(strDomainName)
    Dim Computer
    Dim Group

    Set Computer = GetObject("WinNT://" & strDomainName)
    Computer.Filter = Array("Group")
    For Each Group in Computer
    Response.Write Group.Name
    Next
    End Sub


    Note: strDomainName is the name of your Server 2003.

    Good luck.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width