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?
jamesmetcalf74Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

oBdACommented:
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

1
jamesmetcalf74Author Commented:
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
0
oBdACommented:
Nothing that requires specific privileges, assuming she has the required NTFS permissions.
To make it easier for her, you can use a batch wrapper with PowerShell at its core.
Save this as Whatever.cmd; then she can just run it with a double-click:
@PowerShell.exe -Command "Invoke-Expression -Command ((Get-Content -Path '%~f0' | Select-Object -Skip 2) -join [environment]::NewLine)"
@exit /b %Errorlevel%

$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-Object -Property LastWriteTime -Descending |
			Select-Object -First 1 -ExpandProperty FullName

Copy-Item -Path $latest -Destination (Join-Path -Path $dst -ChildPath recent.txt) -Force
Write-Host "This window will self-destruct in 5 seconds."
Start-Sleep -Seconds 5

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jamesmetcalf74Author Commented:
Thanks!
worked like a charm
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.