Run as Option
Hey, is there a way to implement a "Run as" Option. Currently everything script Run as System. But i have to send the User some Notifications or open Programs. The System User can not do that. This would be as Option like the meshcentral agent operation. Send command as Agent or Current logged in User.
P.s. sorry for my bad sentences or English... that is not my native language
To just send a message you can use the msg command in a batch file. msg * will send the message to all users on that computer. C:\Users\staff>msg /? Send a message to a user.
MSG {username | sessionname | sessionid | @filename | *} [/SERVER:servername] [/TIME:seconds] [/V] [/W] [message]
username Identifies the specified username. sessionname The name of the session. sessionid The ID of the session. @filename Identifies a file containing a list of usernames, sessionnames, and sessionids to send the message to.
-
Send message to all sessions on specified server.
/SERVER:servername server to contact (default is current). /TIME:seconds Time delay to wait for receiver to acknowledge msg. /V Display information about actions being performed. /W Wait for response from user, useful with /V. message Message to send. If none specified, prompts for it or reads from stdin.
Hello!
I`m also need Run as.. Because my script working only if run as User shell or User PoweShell