Need Help creating PowerShell Script

Greeting Experts,

I need help create a PowerShell script to interact with Sysinternals application "psshutdown.exe."  The purpose of the script is to reboot computers that have not restarted after installing updates.  The script needs to be able to read from a .txt file (i.e., list of PCs), prompt the user of the script for Domain Credentials, send out a command to reboot the computer silently, and print out results (successful or Failed) of each machine that is touched by pssshutdown.exe Utility. Can somebody help me create this script....
MikeSecurityAsked:
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.

FOXActive Directory/Exchange EngineerCommented:
1. cd to where you have your psshutdown executable
2. Run the command against your file that contains the list of machines.     psshutdown @c:\temp\computers.txt -u user -p passwd -r -t 5

ref link: https://ss64.com/nt/psshutdown.html
MikeSecurityAuthor Commented:
The person who will be using the script is not very "technology savvy" and is more like an operator. That is the reason I was looking to use a script that will prompt for the user to input Domain credentials, and print out feedback for every device the pssshutdown.exe utility reboots... I am hoping to keep it as simple as possible for the operator who will be running it.
FOXActive Directory/Exchange EngineerCommented:
With this one-liner below the user can input his username and it will prompt for his password

 psshutdown @c:\temp\computers.txt -u operatorsusername  -f -r -t 5 > RSLog.txt 2>&1

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
Kevin StanushApplication DeveloperCommented:
You might want to be careful doing this, as the default security in Windows will require that these credentials (userid/password) have access that you might not want this user to have.  The Windows security right needed is named SeRemoteShutdownPrivilege, and you can get more info here:

https://superuser.com/questions/332548/how-can-i-allow-non-administrators-to-use-shutdown-exe

You can set this right through group policy on your computers.

You also might be able to find a free utility to do this, with a better GUI.  There is probably one out there that can do this and be more friendly, including how it prompts for credentials, if needed.

But definitely look at the security, then you can add this user to a group with the shutdown right.
MikeSecurityAuthor Commented:
the command has completed.
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.