Hi everyone,
I have a Powershell script runs as users login. I have tested , It runs if the user is domain admin, but does not run for domain users.
Set-ExecutionPolicy Bypass
$username=$env:username
$date=Get-Date -format M-d-yy-HHmm
$Source= "\\FServer\Sharefolder\$username"
$Destination="\\Fserver2\Sharefolder2\$username"
$Log="\\Fileserver2\Sharefolder3\Temp\Log-$username-$date.txt"
If ($Source-and $Destination) {
ROBOCOPY $Source $Destination "/E" "/S" "/SEC" "/XD" "AppData" /LOG+:log
}
any help is appreciated.