• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 483
  • Last Modified:

Script with Admin Credentials

I have to copy a data file (imisloc.df1) to C:\Proram files\ASI\iMIS15, getting an error access denied with login user rights.. how to integrate domain admin credential in to the script to copy? (*.bat or ps)
1 Solution
with .bat, you can use the third party Sanur, and then compile to an invisible running .exe to hide the password...

Or with Powershell... there are  a few ways. Some are Powershell specific.

Otherwise, you should be able to use native .NET too for user impersonation.
sumod_jacobAuthor Commented:
I tried below, but getting an error,
+ CategoryInfo          : NotImplemented: (:) [], PSNotSupportedException
 + FullyQualifiedErrorId : NotSupported

Command i tried
Copy-Item p:\imis15\imisloc.df1 "C:\Program Files\ASI\iMIS15" -Credential domainusername
Its prompt for password, but end up in above error..
Gerwin Jansen, EE MVETopic Advisor Commented:
You could try copying as an admin from another machine to \\machine\c$ etc.

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now