Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

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.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

PoSh Remote/Alternate Credentials

Closed Thread
 
Thread Tools Display Modes
Old 12-18-2007   #1 (permalink)
Mark
Guest


 

PoSh Remote/Alternate Credentials

Just need to bounce this off you guys/gals ::
I have a script that runs several checks, using the .Net method, on some
registry values of remote systems. I have 3 domains, and domain admins in
one domain do NOT have rights to systems in other domains. I would like the
script to use the get-credentail cmdlet to prompt for other credentials, the
only problem is that when it does, the script doesn't run all the pieces
correctly (access denied..)

If i log into a system on the other domain (and yes trusts, etc. are all
fine) and run the script as admin it works great.

Thanks,
Old 12-18-2007   #2 (permalink)
Brandon Shell [MVP]
Guest


 

Re: PoSh Remote/Alternate Credentials

Get-Credentials doesn't work like you expect. It does NOT change the current
context. It gives you a System.Management.Automation.PSCredential object you
can pass Get-WMIObject as well as other .NET Classes that implement
System.Net.NetworkCredential
(http://msdn2.microsoft.com/en-us/lib...redential.aspx).

In your case I assume your using the
http://msdn2.microsoft.com/en-us/lib...ey(VS.90).aspx. I
am not sure if you can pass creds to that.


"Mark" <Mark@xxxxxx> wrote in message
news:CB10B988-F2AA-4859-AA69-2B86297D2E58@xxxxxx
Quote:

> Just need to bounce this off you guys/gals ::
> I have a script that runs several checks, using the .Net method, on some
> registry values of remote systems. I have 3 domains, and domain admins in
> one domain do NOT have rights to systems in other domains. I would like
> the
> script to use the get-credentail cmdlet to prompt for other credentials,
> the
> only problem is that when it does, the script doesn't run all the pieces
> correctly (access denied..)
>
> If i log into a system on the other domain (and yes trusts, etc. are all
> fine) and run the script as admin it works great.
>
> Thanks,
Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
executing ps1 from a web browser, alternate credentials gvimercati PowerShell 3 03-13-2008 11:08 PM
running script with alternate credentials jorgemestre PowerShell 2 02-25-2008 09:55 AM
Remote Desktop Credentials Brandon Vista General 0 12-19-2007 04:44 PM
unable to start more copies of a process under alternate credentials John Vista account administration 0 09-01-2007 05:30 AM
How can I start a process on a remote machine using alternate cred JW PowerShell 7 08-14-2007 02:48 PM








Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50