Brian,
Is your AD and users setup something like this?
code:
:MyCompany
:--Computers
:--Delete these later
:----jeff
:----brian
:----greg
:--Groups
:--Policies
:--Servers
:--Users
:----bill
:----dave
:----steve
:--TestGroup
And if so,
1. Does their Home Folders match their logon name?
2. Are they all on the same Server?
3. Are the user folders all under the same PARENT FOLDER. ie. D:\USERS\...
You can use this code to list the users in the group. Then remove the semi colon to create a log of those users.
Then you could also modify it to delete user folders based on this info.
code:
; ListUsersInOU.kix
break on
CLS
;REDIRECTOUTPUT ("C:\TEMP\Delete these later.TXT", overwrite)
$Users = GetObject("LDAP://ou=Users,ou=MyBusinessUnit,dc=MyRegion,dc=MyCompany,dc=com")
for each $member in $Users
? $member.SamAccountName
next
;REDIRECTOUTPUT ("")
If you need further assistance please let us know. Once you have the full working code completed, please post an update with the code so that others may also learn from your experience.