Unable to remove a directory on network drive
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: Unable to remove a directory on network drive
Well I guess then I cannot use takeown, because the "server" in this case is a storage system, and the UNC-path refers to a volume on that storage. There is no drive letter to refer to. Only thing I could come up is to use the PSDrive to give it a temporary drive letter, but that doesn't work
Re: Unable to remove a directory on network drive
If it is a Windows file storage system then the folder has a local path. You need to get the folder path and use that.
Get-WmiObject Win32_Share -ComputerName $server.
WMI will tell you the local path. You must be an administrator on the target system. There is no other way to change ownership of a folder or file. Only administrators on the file server can do this.
Get-WmiObject Win32_Share -ComputerName $server.
WMI will tell you the local path. You must be an administrator on the target system. There is no other way to change ownership of a folder or file. Only administrators on the file server can do this.
Re: Unable to remove a directory on network drive
Unfortunately it is a NetApp storage system. It does have it's own PowerShell CmdLets for management though, but I would much rather use the built in ones that exist in Windows/PowerShell.
Re: Unable to remove a directory on network drive
I do not understand what you are trying to say. It does not matter. You still must be an administrator. TAKEOWN is built into all Windows OSs.timo16 wrote:Unfortunately it is a NetApp storage system. It does have it's own PowerShell CmdLets for management though, but I would much rather use the built in ones that exist in Windows/PowerShell.