Hi, I would like to move (or copy and then delete) a folder from a network share to another networkshare with Powershell but cannot get it to work with get-item, move-item, remove-item etc, because getting access denied all the time while i am an administrator of the domain so thatswhy i would like to use another method in Powershell to make a copy of a folder on a networkshare to another networkshare with the name of the user.
The name of the user is a variable which is asked during execution and based on the input the folder must be moved from and to the \\server\share\nameuser. Can
Robocopy move or copy delete when using the variable as a name, for example (this does not work: Robocopy cannot see the input $naam when given in):
param ($naam) if ($naam -eq $null){ $naam = Read-Host -Prompt "Please enter user logon name" } Set src="\\server\$naam" Set dest="\\server\Users" robocopy %src% %dest% /E
I would prefer to use Powershell but i can copy-item with Powershell then the folder is copied but remove dir or remote-item does not work: access denied although i have enough rights.