Is there a secure and practical way to give a group of users a powershell script to run on their laptops?

The users all have active directory accounts, but their computers are not joined to any domain.

The end goal is to get a basic hardware inventory of each laptop, minimum the amount of required user clicks and user interaction time. Of course there is hardware assert/inventory software, but it would be ideal to not spend a lot of admin time learning/setting it up, free it always nice.

The powershell script I have (glad to share) collects everything and e-mails it to any address. It only took 15 minutes to write, but now need to get it sent out to users.

Client laptops are guaranteed Windows 10 fully updated.


  • The email is sent using user credentials. A script command uses a system challenge the request uid/pwd from the user, so they are never part of the script.

  • One security concern I didnt mention is how to allow them to run the script? Seems you can't download and double-click to run a ps script, is there a way to sign them that would allow this? I've found a util to compile it to an .exe, which may work but seems to encourage bad habits.

  • I can't walk around and run it myself because the users are all over the country.


1 Answer 1


From a security perspective there is no issue, aside from maybe an awareness problem (e.g. users being taught to execute scripts they might not understand). Do note that most computers may not allow the execution of PowerShell scripts by default, it is something that must be enabled.

One thing to note: how does it actually email all of those things back to you? Does it open their Outlook or does it generate a file that they send back to you? You would not want to hardcode credentials in the script.

The best way would actually be to visit each user, and run the script yourself manually.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .