Solved

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

Posted on 2012-12-27
10
1,146 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
  • 4
  • 2
  • 2
  • +1
10 Comments
 
LVL 53

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 53

Expert Comment

by:McKnife
ID: 38724355
Sorry, simply missed "powershell". Not experienced in file operations via PS, sorry.
0
 
LVL 40

Assisted Solution

by:Subsun
Subsun earned 250 total points
ID: 38724387
0
Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 

Author Comment

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

Accepted Solution

by:
Qlemo earned 250 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 68

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
This article will help you understand what HashTables are and how to use them in PowerShell.
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

912 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now