Pass password to Run as Network Account in powershell


hello,

i have powershell script passed on bat file. executed etl tool runs via network account.

hence powershell script needs run through network service account.  i have passed domain/username in runas command,  the output file of .bat file "enter password of afsuk/svc_dev:" . can guide me on how pass password?

runas /u:afsuk/svc_dev "powershell -file e:\scripts\extract_zip.ps1 e:\test\test.zip e:\test"

extract_zip.ps1 powershell script unzipping files 'e:\test\test.zip' ' 'e:\test' ; content of extract_zip.ps1 follows,

param([string]$zipfilename, [string] $destination)

if(test-path($zipfilename))
        {
$shellapplication = new-object -com shell.application
$zippackage = $shellapplication.namespace($zipfilename)
$destinationfolder = $shellapplication.namespace($destination)
$destinationfolder.copyhere($zippackage.items())
}

i suggest move thread scripting forum instead better @ assisting matter. 

thanks

denis


regards,

denis cooper

mcitp ea - mct

help keep forums tidy, if has helped please mark answer

blog: http://www.windows-support.co.uk  twitter:   linkedin:



Windows Server  >  Directory Services



Comments

Popular posts from this blog

CRL Revocation always failed

0x300000d errors in Microsoft Remote Desktop client

Failed to query the results of bpa xpath