Sathish Kothandam
Sathish Kothandam

Reputation: 1520

How to make powershell script executable only [No read/write Permission]

I have a power shell script which runs on when the user is logged on and logged off. The script have confidential information such as admin user id and password. So i want this script to be only executable with no read/write permission.

Is there any way to achieve this.?

Thanks,

Upvotes: 0

Views: 1195

Answers (2)

mjolinor
mjolinor

Reputation: 68273

Why embed admin credentials in the script? You can set it up as an event-triggered scheduled task (based on the logon and logoff events), and register it to run under the admin creds. The password will be stored with the task registration and not visible to the user.

Upvotes: 1

Related Questions