![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | How do I control the user context in my powershell I know powershell is for admins... but how do I control the user context used by my cmdlets. let's say for example, i am logged in as paulmcd . i am NOT a domain admin or an exchange admin. however, i want to perform domain admin actions in my powershell, like adding a new user, or mailbox, or other admin stuff. how do i specify which credentials a cmdlet should use when doing it's thing. for example, in exchange, i am trying to do a "new-accepteddomain" cmdlet. this requires me to be an exchange admin. but i don't want to login as an exchange admin. i have noticed that "SOME" cmdlets take the -credentials paramete, which is a PSCredentials object. but it appears that NOT all of them take it. or do they? here is my question: is there some global , fool proof way, that I can provide crednetials that I want a cmdlet to run as ? this is very similar to the runas command in win32. how do i do that with powershell . note: ideally, this is generic, and in a way I can also control it programmatically, as I am also calling cmdlets from c# .net code. this is where it really kicks in, as if you want to call a cmdlet from asp.net, you can be pretty sure your asp.net is NOT running as a domain admin. but i want to be able to still use powershell, so need to pass in credentials somehow. i am using RunspaceInvoke from asp.net. thanks!!! -paulmcd |
| | #2 (permalink) |
| Guest | Re: How do I control the user context in my powershell I should add as a note... the real thing I am trying to do here is use powershell from asp.net my scenario is i have users, that are NOT domain admins. they log into my asp.net site. i control what they can and can't do. some of the actions, require me making changes in exchange server or ad. specifically like calling new-accepteddomains (exchange 12) . i do NOT want the asp.net user to have these rights. so i want to call the powershell cmdlet, using my exchange admin creds. hope this clears up what my scenario is. i'm using asp.net and RunspaceInvoker. thanks!! -paul |
| | #3 (permalink) |
| Guest | Re: How do I control the user context in my powershell paulmcd wrote: <snip> > is there some global , fool proof way, that I can provide crednetials > that I want a cmdlet to run as ? I have the same issue, but that's mostly just because I don't want to load and unload my "super" account profile every time I want to run a quick script to check on our Exchange queues. I see two sides to this question (both of which I could use answers for)... -Does anyone have a way to run an individual cmdlet in a particular security context? -Is there a way to switch the security context of a Powershell script or session without reloading PS using a RUNAS or Explorer's "Alternate Credentials" option? --Jonathan "smthng" Kalmes http://smthng.info |
| |
| |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Control the Maximum allowed User Sessions in Fast User Switching | lmlm | Vista General | 1 | 03-19-2008 08:19 AM |
| Per-user shell context menu extensions? | Keith MacDonald | Vista security | 6 | 01-17-2007 07:52 AM |
| finding the logged on user (user name) with powershell using WMI? | klumsy@xtra.co.nz | PowerShell | 3 | 09-25-2006 12:21 PM |
| job control in PowerShell | Adam Milazzo [MSFT] | PowerShell | 6 | 09-01-2006 03:42 PM |
| Finding out what control the context menu call belongs to? | Mario Goebbels [489782] | Avalon | 0 | 03-24-2006 10:45 AM |