2

Hello Folks, I have a powershell MTA (GUI script using winForms), which works well, lets take the script name to be "ENDUserMTA.ps1" which does invoke certain commands and does something which really needs admin rights. this works fine when run manually or via task scheduler or when set via [registry] RunOnce or Run or whatever when there is admin rights..

The problem is i want to invoke this script on the END users laptop and make them to work with it [interactively] Options that i have tried so far:

  1. Tried Scheduling the "ENDUserMTA.ps1" in Task Manager SYSTEM account [using When running the task, use the following user account] - this starts and run NOT INTERACTIVE [since system account does not have interactive session]

  2. Tried Scheduling the "ENDUserMTA.ps1" in Task Manager with Different user account which has admin rights [using When running the task, use the following user account] - This again starts but the GUI is not shown to the End User who has logged without admin rights, rather shown to only the user who was set under the option [When running the task, use the following user account]

My situation is not possible to create PSSessions or Delegated Remoting. I am now is middle of forest and no where to go!!!

Not sure how to invoke the script as admin to a user who has logged into a machine without admin rights..

WHat i exactly need or similar solution: When scheduling this script, i schedule the script to start atlogon[any user], after the script completes it will delete the scheduled task

Pls help.. Balaji

1 Answers1

0

Begining on Vista Microsoft has started to separate UI stacks for security reasons.

My advise for your problem is to change the architecture of your code in order to create two scripts.

  • The first one with no UI will be scheduled with administrative rights

  • The second one with UI will be started with the user rights and will be a client of the first one.

You can use Inter-Process Communication between the two scripts, but you will met a security issue, you server part vill need particular ACLs to allow the client part to connect.

It exists other way to communicate between scripts, but it's not so easy with an asynchronous UI architecture on one side. It would be simple using managed code (.NET code) or native code(unmanaged code). For me, you are on the limit of the scripting place even if scripting capacities are very large as far as PowerShell is built on the top of .NET.

JPBlanc
  • 70,406
  • 17
  • 130
  • 175