|
-
Jun 29th, 2006, 09:40 AM
#1
Thread Starter
New Member
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!
-
Jul 3rd, 2006, 04:45 AM
#2
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|