Title: Message
We need disk quotas to work and as this is based on file ownership I try very hard to make sure that the NTFS owner is the real owner. Sadly, this doesn't always work.
 
I've used a script like Tim's to look for folders which don't have a matching user but it isn't perfect. For a small group of failures I'm happy to manually check but I know that this has got to the point where it needs automating.
 
In theory username=home foldername=owner name but in reality this isn't always the case (eg student enrols, gets given a number, account is set up, all is good. It then turns out that they have previously been a student; they get given a new student number and the old account is reactivated. We now have two home folders which are really owned by the same person. We need to make sure that we don't lose the contents of the first folder; that should get manually moved to the older folder when the account is changed but helpdesk people don't always get this right :-(
 
Thanks again for everyone's help - I'll now try *very* hard to remember yet another convention for escape characters!
 
Steve
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of joe
Sent: 22 March 2006 02:00
To: [email protected]
Subject: RE: [ActiveDir] Script to find owner of home directory

This could prove troublesome, I would expect most of the home folders would have an owner of administrator.
 
--
O'Reilly Active Directory Third Edition - http://www.joeware.net/win/ad3e.htm 
 
 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of matheesha weerasinghe
Sent: Tuesday, March 21, 2006 5:43 AM
To: [email protected]
Subject: Re: [ActiveDir] Script to find owner of home directory

Why dont you ask NTFS instead of AD? Why not you use something like subinacl and query the folders of the owner? Assuming all folders that are valid have proper owners, I guess the invalid folders will have unresolvable SIDs or Administrator as the owner against them.
 
M@

 
On 21/03/06, Steve Rochford <[EMAIL PROTECTED]> wrote:
I know to write a script which will take a username and find that user's
home directory but can I do the reverse? What I want to to is clean up
the home directories folders - I've got nearly 20,000 home folders but
only about 15,000 active accounts so what I want to do is take each
folder name and ask AD who it belongs to.

I've tried using LDP with the query:

(homedirectory=\\tconwl11\home\1973)

but I get no results (but I know that I should get a result - that's my
home folder!) and I've tried the same thing as an ADSI search in
_vbscript_ and also get no results.

I also tried Joe's ADFind:

AdFind.exe -b dc=cnwl,dc=ac,dc=uk -f
"homedirectory=\\tconwl11\home\1973"

AdFind V01.29.00cpp Joe Richards ([EMAIL PROTECTED] ) December 2005

Using server: tconwl4.cnwl.ac.uk:389
Directory: Windows 2000


0 Objects returned

Steve
List info   : http://www.activedir.org/List.aspx
List FAQ    : http://www.activedir.org/ListFAQ.aspx
List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/

Reply via email to