MSH C:\Documents and Settings\mow> $cred = get-credential ; [System.Diagnostics.Process]::start("cmd.exe",$null,$cred.UserName,$cred.passworyou can also use MSH for this so you can do a runas on the commandline.
d,$null)
Cmdlet get-credential at command pipeline position 1
Supply values for the following parameters:
Credential
User: mow
Password for user mow: *********
Handles NPM(K) PM(K) WS(K) VS(M) CPU(s) Id ProcessName
------- ------ ----- ----- ----- ------ -- -----------
0 0 1196 84 2 0,03 740 cmd
MSH G:\Monad> [System.Diagnostics.Process]::start("cmd.exe",$null,$cred.name,$cred.password,$null)
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\mow>
Handles NPM(K) PM(K) WS(K) VS(M) CPU(s) Id ProcessName
------- ------ ----- ----- ----- ------ -- -----------
29 2 1944 2384 29 0,03 3944 cmd
MSH G:\Monad> ver
Microsoft Windows XP [Version 5.1.2600]
C:\Documents and Settings\mow>ver
'ver' is not recognized as a Cmdlet, function, operable program, or script file.
At line:1 char:3
+ ver <<<<
MSH G:\Monad>
October 2005 November 2005 December 2005 January 2006 February 2006 March 2006 April 2006 May 2006 June 2006 July 2006 August 2006 September 2006 October 2006 November 2006 December 2006