Powershell: starting installed Windows applications via 1 command in Powershell?

janhoedt
janhoedt used Ask the Experts™
on
Hi,

I logon to my Windows with a user which has no rights in the domain (ADUC etc). However, when I need to run a Powershell or Activey Directory etc, I need to "run as" which is a pita.
Isn't there a way I can enter f.e. ADUC and then launch Active Directory users & computers?

Please advise.
J
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2014

Commented:
Isn't there a way I can enter f.e. ADUC and then launch Active Directory users & computers?
I'm really not sure what you're asking.  ADUC and "Active Directory users & computers" are the same thing.  Enter ADUC where?

Your options really are:
 - using "Run as a different user"
 - logging on to a machine as the user with needed rights.  This could be a special machine accessed via RDP that is only used for administrative tasks (a jump box).
 - for many things in PowerShell there is a credential parameter.

Author

Commented:
no that's not what I m looking for
Top Expert 2014
Commented:
Sure sounds like it (if not, you need to elaborate).
Here's an example for #3.
$cred = Get-Credential
function aduc
{
    Start-Process powershell.exe -Credential $cred -ArgumentList "Start-Process mmc.exe dsa.msc"
}
aduc

Open in new window

The above may not work for everything.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial