Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

The Context: Powershell launched as a domain admin.

From this Powershell window, Is it possible to open c$ of a remote box (\server\c$) in explorer.exe without asking for credential (using the current credential) ?

Thanks

share|improve this question

3 Answers 3

Yes, if you cd into \\server\c$ you can run invoke-item on the current directory.

cd \\server\c$
ii .

Or you can invoke the directory directly

invoke-item \\server\c$
share|improve this answer
    
Thanks Andy! But it does not work from a powershell (launched as domain admin in my case) –  Xavier C Dec 9 '09 at 20:15

I found the solution:

Thanks for your help Andy.

I found the solution, reading this article from windowsitpro.com

I had to modify a key in the register of the domain admin profile on my workstation. Since i'm not the only admin in my company, I included the key modification in my script. And i'm not asked for credential! Beautiful! Here you go:

$RegKey ="HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\advanced"
$user = $env:username
$domain = $env:userdomain
set-ItemProperty -path $RegKey -name SeparateProcess -value 1
net use \\$args\c$ /user:$domain\$user
explorer.exe \\$args\c$

I used net use, but there are many ways to do this, for example you can also use RUN AS

runas /user:domain\username explorer.exe

Hope that's help

share|improve this answer

I know this is an old thread, but for anyone else coming across it... might I suggest

$OpenFileDialog = New-Object System.Windows.Forms.OpenFileDialog
$OpenFileDialog.initialDirectory = "\\Servernamehere\c$"
$OpenFileDialog.filter = "All files (*.*)| *.*"
$OpenFileDialog.ShowDialog() | Out-Null

the out-null bit just stops it writing a line of output to the console

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.