Link to home
Start Free TrialLog in
Avatar of Jim Metcalf
Jim MetcalfFlag for United States of America

asked on

standard user running a powershell script

PowerShell execution policy.  I have a user that is a standard user on her computer... no admin privileges.  I have a powershell script that will run for me as an administrator but not for her when she is logged in.  lets say her name is jane doe.   her login is jane.doe with a domain name of dog.

how can i change her privileges to run this certain ps1 script?
Avatar of oBdA
oBdA

What exactly is the problem?
How are we supposed to tell you which privileges to change if you tell us nothing about what the script is doing?
The execution policy, if that what your problem is, can be set per user:
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned -Force

Open in new window

Or start the script while telling PowerShell which execution policy to use:
powershell.exe -ExecutionPolicy Bypass -Command "& 'C:\Temp\Whatever.ps1'"

Open in new window

Avatar of Jim Metcalf

ASKER

My user runs this daily so i basically need her to be able to double click the script and have it do the following
this powershell script is grabbing a file from a file share and placing the file on the local machine

$src = "z:\"  # change to your source directory
$dst = "C:\Route file"  # change to your destination directory
$latest = (Get-ChildItem -Path $src -Filter *.txt -File |
    sort -Property LastWriteTime -Descending | select -First 1).FullName

Copy-Item -Path $latest -Destination (Join-Path -Path $dst -ChildPath recent.txt) -Force
ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

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
Thanks!
worked like a charm