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