Set owner on a network share folder

Dec 4, 2014 at 5:20 PM
Hello,

i just downloaded and installed this module to do one task: delete multiple old profiles on our servers. Manually, i have to go on a network share where the profile is, set the owner (myself), set the rights for the owner, and delete the profile folder. It works fine but we have hundred of profiles to delete, so i want to do a script.

I tried the "set-owner" command but without success:
Set-Owner -Account DOMAIN\myself -Path \domain.fqdn.st\directory...
Set-NTFSOwner : Le fichier spécifié est introuvable. (Exception de HRESULT : 0x80070002): [\?\UNC\ \domain.fqdn.st\directory...]
In english, i translate: "specified file is not found". Notice the "\?\UNC\" before my path.

I test this command on a local directory and it works fine. I don't understand why i can set manually an owner and i cannot using this Cmdlet. Any ideas?

(Sorry for my english, i am french)
Coordinator
Dec 9, 2014 at 7:16 PM
Hi,

can you be a bit more specific about the environment?
PS C:\Users\Administrator\Desktop> Set-Owner \\a.vm.net\DFS1\Homes\a877777 -Account a\a877777 -PassThru

Item                                                     Owner
----                                                     -----
\\a.vm.net\DFS1\Homes\a877777                            A\a877777
I have just tried the following and it worked:

Thanks,
Raimund