Solved

Powershell studio run as

Posted on 2016-09-27
3
109 Views
Last Modified: 2016-09-27
Has anyone used powershell studio before? I am using it and want create a form that will allow some of our staff to move users around in active directory.  I can create the form and it works but if I want a non domain admin to run the software they cannot modify the AD. I expect this but I see there is a "run as" setting in the deployment settings.  I have tried to enter in domain admin credentials but when I run it as another user the form does not launch. It says "the directory name is invalid".  I can launch the program just fine if I am logged into the account that I entered in the "run as" settings and the form opens fine for all users if I don't enter a user in the run as settings.
0
Comment
Question by:Roccat
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
ID: 41817983
Use -Verb Runas to run the PowerShell session 'Run As Administrator' from an non-elevated session
Example, the code which you want to run with elevated privileges can be placed in scriptblock ..
Start-Process Powershell.exe {
  #Your code here 
    Get-WinEvent -ListLog Security
  #Above is sample code
} -Verb Runas

Open in new window


Ref: http://ss64.com/ps/syntax-elevate.html

PS: If this didn't fix your issue, then please post the exact error message and the code block which fails so we can take a look at it.
0
 

Assisted Solution

by:Roccat
Roccat earned 0 total points
ID: 41818121
Thank you Subsun. It appears this is the solution.  
"Launch the file from a folder that is accessible for all users and processes and you should not get that message."

I place the exe file that poweshell studio creates and put it in the root of the C drive and it worked.
1
 

Author Closing Comment

by:Roccat
ID: 41818123
Thanks!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Utilizing an array to gracefully append to a list of EmailAddresses
A brief introduction to what I consider to be the best editor for PowerShell.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question