Link to home
Start Free TrialLog in
Avatar of kuzum
kuzum

asked on

powershell for home folder owner change

Dear Experts,

Could you please help me with this.

I have over 500  user  home folders on a file share

Current owner of some of those home folders are  not the  actual user owners.  I can see that administrator as current owner on some and some other names as owner of some others home folders.  So it is a bit mess to me.

during the account creation, home folder names gets added as %username% in the home folder section in AD.  

For reporting purposes ( to identify who is owner of another home folder)  and to assign ownership of home folders to actual users, Could you please provide me with a PowerShell to run against   \\server\share\users\home ?

for an example;

Mike has a home folder called Mike.Buck   if his home folder's owner is administrator or another user, I would like to be informed about it on a excel and meanwhile, current owner must be changed to Mike.Buck.  I believe Mike must also have full ntfs permissions to his home folder.

thanks
SOLUTION
Avatar of Dustin Saunders
Dustin Saunders
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kuzum
kuzum

ASKER

Dustin,

this is just excellent!  output was as I expected.

I'm assuming it is only exporting home folders that currently owned by others and not exporting Mike.Buck as Mike already owner of his home folder?

One small favour please, if I wanted to run this against a specific OU in AD ( I want to do 100 users a day),  could you modify it for me?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kuzum

ASKER

excellent result.