Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Monday, August 13, 2012 2:32 PM
Hi.
I need to copy a file from a server in one domain, to another server in another domain.
I tried using the Copy-Item command specifying the -Credential parameter. But credentials are aparently not available for that provider...
Any ideas?
Best regards
Peter
All replies (7)
Tuesday, August 14, 2012 5:34 AM ✅Answered | 2 votes
net use \\<server name>\IPC$ /USER:<domain>\<account password copy file \\server\share
net use * /del
Wednesday, August 15, 2012 6:26 AM ✅Answered
Thanks Kazun.
I ended up using the following command in powershell:
#Map network drive
net use x: $destinationFolder $password /user:$domain\user /p:no
#Performing copy operation
Copy-Item $filePath x:
Examples of net usage can be found here: http://pcsupport.about.com/od/commandlinereference/p/net-use-command.htm
Monday, August 13, 2012 2:41 PM
Use new-psdrive to map ps drives to the source and target locations (new-psdrive does take a -credential parameter), then use the psdrive references in your copy-item.
[string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "
Monday, August 13, 2012 2:50 PM
Hi.
I need to copy a file from a server in one domain, to another server in another domain.
I tried using the Copy-Item command specifying the -Credential parameter. But credentials are aparently not available for that provider...
Any ideas?
Best regards
Peter
I think you cant to migrate the files and conserving NTFS permissions. If yes, you can use robocopy utility.
Well, if you want to migrate SIDs in use, consider migrating and maybe merging users' accounts using ADMT.
This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.
Microsoft Student Partner 2010 / 2011
Microsoft Certified Professional
Microsoft Certified Systems Administrator: Security
Microsoft Certified Systems Engineer: Security
Microsoft Certified Technology Specialist: Windows Server 2008 Active Directory, Configuration
Microsoft Certified Technology Specialist: Windows Server 2008 Network Infrastructure, Configuration
Microsoft Certified Technology Specialist: Windows Server 2008 Applications Infrastructure, Configuration
Microsoft Certified Technology Specialist: Windows 7, Configuring
Microsoft Certified Technology Specialist: Designing and Providing Volume Licensing Solutions to Large Organizations
Microsoft Certified IT Professional: Enterprise Administrator
Microsoft Certified IT Professional: Server Administrator
Microsoft Certified Trainer
Monday, August 13, 2012 2:50 PM
Thanks for your reply!
I tried the following:
$username = 'DOMAIN\userName'
$password = 'password'
$cred = New-Object System.Management.Automation.PSCredential -ArgumentList @($username,(ConvertTo-SecureString -String $password -AsPlainText -Force))
New-PSDrive -name X -psprovider FileSystem -root \112.0.12.3\d$\temp
I got the following error:
The provider does not support the use of credentials. Perform the operation again without specifying credentials.
At line:1 char:1
- <<<< New-PSDrive -name X -psprovider FileSystem -root \112.0.12.3\d$\temp -Credential $cred
+ CategoryInfo : NotImplemented: (:) [], PSNotSupportedException + FullyQualifiedErrorId : NotSupported
Am I doing it wrong?
Best regards
Peter
Monday, August 13, 2012 4:54 PM
Credential support for New-PSDrive is only supported on Powershell V.3
Grant Ward, a.k.a. Bigteddy
Monday, August 13, 2012 5:22 PM
You are correct. My mistake.
[string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "