Steve,

I think you are looking for something like this..

code:
 BREAK ON
$userfile = "@CurDir\UserDump.xls"
IF Exist("$UserFile")
DEL "$UserFile"
ENDIF
$xl = CreateObject("Excel.application")
IF @error
EXIT
ENDIF
$rc = $xl.workbooks.add
$xl.cells(1, 1).value = "User ID"
$exlrow = 2
$crtheader = -1
$domain = GetObject("WinNT://@LDOMAIN")
$domain.filter = User,""
FOR EACH $user IN $domain
$user.getinfo()
? $user.name " ..."
$xl.cells($exlrow, 1).value = $user.name
FOR $i = 0 TO $user.propertycount
$property = $user.next
IF $property
IF $crtheader
$xl.cells(1, $i + 2).value = $property.name
ENDIF
$xl.cells($exlrow, $i + 2).value = $user.get($property.name)
ENDIF
NEXT
$exlrow = $exlrow + 1
$crtheader = 0

NEXT
$xl.rows("1:1").select
$xl.selection.font.bold = True
$xl.cells.select
$xl.range("R1").activate
$xl.cells.entirecolumn.autofit
$xl.rows("2:2").select
$xl.activewindow.freezepanes = True
$xl.activeworkbook.saveas("$UserFile")
$xl.quit
EXIT

HTH,

Kent

[ 27. September 2002, 16:46: Message edited by: kdyer ]
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's