?
Solved

With Powershell How to authenticate into a workgroup computer C$ from a Domain computer ?

Posted on 2012-12-27
10
Medium Priority
?
1,235 Views
Last Modified: 2012-12-27
Hello all,

I have a domain computer & user domain where I run all my scripts. But, in my current case I need to authenticate into a workgroup computer in order to get a file

File is located at \\computername\c$\folder\file.csv

Thanks for your help,
G
0
Comment
Question by:namerg
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
  • +1
10 Comments
 
LVL 56

Expert Comment

by:McKnife
ID: 38724252
Hi.

There is a difference if the target computer runs vista/7 or 8 compared to win xp - so what OS is it?

If the administrative share c$ is accessible (share active, not blocked by a firewall, option described here set http://support.microsoft.com/kb/942817 ), then simply connect a network drive and use credentials like this:
user: targetsystemname\adminoftargetsystem
pw: anythingbutnotempty!
0
 

Author Comment

by:namerg
ID: 38724272
The target is a Server 2008, but in my testing I am using a Win7 in a workgroup mode.

Via GUI i can do \\computername\c$\folder\ and i get prompted then I get access but I want to avoid that and do it via powershell

Thanks for your help,
0
 
LVL 56

Expert Comment

by:McKnife
ID: 38724355
Sorry, simply missed "powershell". Not experienced in file operations via PS, sorry.
0
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 
LVL 40

Assisted Solution

by:Subsun
Subsun earned 1000 total points
ID: 38724387
0
 

Author Comment

by:namerg
ID: 38724392
Jiji...I am reading that one...
0
 
LVL 70

Accepted Solution

by:
Qlemo earned 1000 total points
ID: 38724584
You can still use the "DOS" net use for authenticating. Just execute
 net use \\targetserver\c$ /u:targetserver\targetadmin targetpwd
and you should be able to access the drive as \\targetserver\c$ from PS. That is still easier than to set up Remoting, though Remoting is the better way if you want to execute stuff remotely (not just get some files).
0
 

Author Comment

by:namerg
ID: 38724607
Damnn, you are right...too late to split points. :(
0
 

Author Comment

by:namerg
ID: 38725140
Qlemo,

I am trying to do the following

Clear-Host
Start-Sleep -Seconds 5
net use Z: \\computername\c$ /u:computername\username 'password'

But, I do not see the Z drive.

By the way, i did open a question about it.

Thanks for your help.
0
 
LVL 70

Expert Comment

by:Qlemo
ID: 38725354
If you post a follow-up question, please provide the link, so we do not have to search for it ;-).

I've tested to map a network drive, and had no issues with accessing it using a drive letter. Whatsoever, the New-PSDrive method shown in the other question is the "better"  method as it is fully integrated into PS. Be aware that the drives mapped with New-PSDrive are not visible to DOS commands.
0

Featured Post

WatchGuard's M Series Appliances - Miecom Approved

WatchGuard's newest M series appliances were put to the test by Miercom.  We had great results and outperformed all of our competitors in both stateless and stateful traffic throghput scenarios! Ready to see how your UTM appliance stacked up? Download the Miercom Report!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
In the absence of a fully-fledged GPO Management product like AGPM, the script in this article will provide you with a simple way to watch the domain (or a select OU) for GPOs changes and automatically take backups when policies are added, removed o…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question