Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

How to run a powershell script in admin account

$
0
0

Hi all,

I have a powershell script and this script should run under a given account credential(admin).               Please send me a powershell command which will ask for credential and after giving that credential,  the script should run in that given credential rather than already opened old windows credentials.

Example:-

If say for example, the windows username is xyz and password is xyz ..

But i have a admin credentials say username is abc and password is abc..

Now im opening the powershell command under windows credential xyz and im running the script.

Now i wanted the script to run in admin (abc credential)..

Is there any powershell command which will ask for admin credential and after giving that credentails,  the script will run under that given admin credential..? Please hep me ..


Sharath Kumar R



Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>