Question : Execute Powershell Script  through wmi remote process remotely problem on V1?

Hi ,
I am facing an issue while running a powershell script through wmi remote process ,the script doesn't execute eventhough i use     -executionpolicy unrestricted
like below in the code area
are there any known issues with Powershell V1 .i can't use v2 for it is production server.
the issues i am not clear about are
1.) wmi process to execute script remotely
2.)are there any other policies that could override  -ExecutionPolicy Unrestricted  and don't allow me to execute scripts through remote wmi process(I guess "run as administrator" doesn't apply in wmi process)

please very very urgent i got to submit this today .
Thanks  in advance
Code Snippet:
1:
2:
3:
4:
5:
6:
$PowershellPath = "$WinDirectory\WindowsPowerShell\v1.0\powershell.exe" 
 
$CommandLine = "$PowershellPath   -ExecutionPolicy Unrestricted -command &{& $UNCFolderPath\ScriptProcessor.ps1 $RemoteLogpath}"
 
#So i am exepecting $RemoteLogpath  to have some value but returns nothing 
#Hence i checked it just "hello" message to a file but nothing comes up
Open in New Window Select All

Answer : Execute Powershell Script  through wmi remote process remotely problem on V1?

Hi
This does not answer your question, but offers a workround. You can use PSexec to run powershell commands remotly
psexec \\server cmd /c "echo . | powershell start-service iis* ; start-service iis*'"

this also has been scripted into a tool here ,( includes links for free download of psexec ) Invoke-RemoteExpression.ps1

joe
Random Solutions  
 
programming4us programming4us