If it has a plug, it's IT stuff

Jul 31 2008   3:34PM GMT

[TLBAT] Intranet: Enumerate client computer groups and their members



Posted by: alessandro.panzetta
Tags:
Active Server Pages
Intranet portal
IT support
self-service

So here we are…on the field :)

This is just a soft start, in this page we will create a page that shows the groups on the client computer that is surfing the ASP page and their relative members.

First we need to understand that this will work only in an environment where the security has been correctly set and on the IIS server for the directory where we will store the ASP files, the anonymous authentication has been disabled and the Windows authentication enabled. This must be done otherwise the pages will be run with the IUSR_xxxx account that has no privilege on the computers, if we enable the Windows authentication instead, the pages will be run by the logged on User.

Here is our first ASP page, copy the text below and paste it to your local_groups_members.asp page in the folder for the self service portal and run it.

==================================

<%@ language=”VBSCRIPT” %>

<%

Dim ComputerName

ComputerName = Request.ServerVariables(“REMOTE_HOST”)

%>

<html>

<head>

<meta name=”GENERATOR” content=”SAPIEN Technologies PrimalScript 3.1″>

<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>

<title>[<% Response.Write ComputerName %>] Local Groups and their members</title>

</head>

<body>

<%

Set colGroups = GetObject(“WinNT://” & ComputerName & “”)

colGroups.Filter = Array(“group”)

Response.Write “<font face=tahoma size=3>”

Response.Write “Here is the list of the local Groups and their members for computer:<b>” & ComputerName & “</b><br><br>”

Response.Write “<table border=2 bordercolor=#006699>” & VbCrLf

For Each objGroup In colGroups

Response.Write “<tr><td bgcolor=’#006699′><font face=tahoma size=3 color=’white’> <b>” & objGroup.Name & “ </td></tr>” & VbCrLf

For Each objUser in objGroup.Members

Response.Write “<tr><td bgcolor=white><font face=tahoma size=2 color=’#006699′> ” & objUser.Name & “ </td></tr>” & VbCrLf

Next

Next

Response.Write “</table>” & VbCrLf

%>

</body>

</html>

==================================

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: