\r\n
\r\n/**\r\n * Script: listusers.js\r\n * Purpose: Lists all users in a domains.\r\n * Author: Daren Thiel \r\n * Date: 06 Mar 2001 \r\n * Web: [link|http://www.winscripter.com|http://www.winscripter.com]\r\n **/\r\n\r\n\r\nshowusers( "PDC-NAME" );\r\n\r\n/**\r\n * showusers - prints list of user accounts and their full names\r\n * for a given domain.\r\n *\r\n * example - showusers( "DOMAINNAME" );\r\n * - showusers( "DOMAINNAME/Computer" );\r\n **/\r\n \r\nfunction showusers( domain )\r\n{\r\n try\r\n {\r\n var users = GetObject( "WinNT://" + domain );\r\n var e = new Enumerator( users );\r\n for( ; !e.atEnd(); e.moveNext() )\r\n {\r\n var user = e.item();\r\n if( user.Class == "User" )\r\n {\r\n print( "User : " + user.Name );\r\n print( "Full Name : " + user.FullName );\r\n print( "============================" );\r\n }\r\n }\r\n }\r\n catch( e )\r\n {\r\n print( "Error: " + e.description );\r\n }\r\n}\r\n\r\nfunction print( msg )\r\n{\r\n WScript.Echo( msg );\r\n}\r\n\r\n\r\nHow do I change it to export the results to a file, instead of that damn popup window?\r\n