HTA Script To Retrieve NT Or AD Group Names

 

This HTA script will allow you to enter a Domain Controller (DC) Server name into an input box and will enumerate all of the Groups for that server to the active window.

 

HTA Script:

 

<Html>

<Head>

<Title>HTA Script</Title>

<Style>

Body {Background-Color: CornSilk}

</Style>

 

<HTA:Application

Caption = Yes

Border = Thick

ShowInTaskBar = No

MaximizeButton = Yes

MinimizeButton = Yes>

 

<script Language = VBScript>

Sub WindowsLoad

strHTML = "<table border='1' style='border-collapse: collapse' bordercolor='SaddleBrown' id='Table1' >"

strHTML = strHTML & "<tr>"

strHTML = strHTML & "<td width='10%' bgcolor = 'SeaShell'><font color = 'Blue'><b>Group Name</td>"

strHTML = strHTML & "</tr>"

 

strComputer = MachineName.Value

Set objComputer = GetObject("WinNT://" & strComputer)

objComputer.Filter=Array("group")

 

For Each group In objComputer

strHTML = strHTML & "<tr>"

Window.Document.Title = "Group Names For: " & UCase(strComputer)

strHTML = strHTML & "<td width='1%'>" & group.Name & "</td>"

Next

strHTML = strHTML & "</tr>"

strHTML = strHTML & "</table>"

DataArea.InnerHTML = strHTML

End Sub

 

</script><Body>

<p><h3 align = center><font color='Orange'>Please Visit myITforum.Com</font></h3>

<div></div>

Enter Machine Name: <Input Type = "Text" Name = "MachineName">

<Input Type = "Button" Value = "Run Script" Name = "Run_Button" onClick = "WindowsLoad"><P>

<Span Id = "DataArea"></Span></Body><Div Align = "Center">

<P><A Href="http://myitforum.com/cs2/blogs/dhite">Created For myITforum By Don Hite</A>

 

 

Published Sunday, December 30, 2007 1:51 PM by dhite
Filed under:

Comments

No Comments