Solved

Power Shell Sapien Primal Forms

Posted on 2013-06-18
4
358 Views
Last Modified: 2014-09-30
Hi i'am very new to this well very very very new, i am trying to create form with primal forms with a text box to enter computer name and with 2 button that will go install java and the other will install flash to a the remote computer put in the text box .

Thanks in advance
0
Comment
Question by:CarlosReyes1
4 Comments
 

Author Comment

by:CarlosReyes1
ID: 39257430
ok this is what i have so far

$compname=$compname.text
Copy-item -Path \\servername\java -recurse \\$compname\c$\windows\temp\
([WMICLASS]"\\$RemoteSystem\ROOT\CIMV2:win32_process").Create("cmd.exe /c \\$compname\c$\windows\temp\java\jre.exe /s`" /qn")      

}

This is the error is coming back with

ERROR: Cannot convert value "\\\ROOT\CIMV2:win32_process" to type "System.Management.ManagementClass". Error: "Invalid parameter "
DeploySoftware.pff (57): ERROR: At Line: 57 char: 12
ERROR: +     ([WMICLASS] <<<< "\\$RemoteSystem\ROOT\CIMV2:win32_process").Create("cmd.exe /c \\$compname\c$\windows\temp\java\jre.exe /s`" /qn")
ERROR:     + CategoryInfo          : NotSpecified: (:) [], RuntimeException
ERROR:     + FullyQualifiedErrorId : RuntimeException
ERROR:

Thanks in advance
0
 
LVL 10

Accepted Solution

by:
JoeKlimis earned 500 total points
ID: 39918059
hi

The problem with this line is you have an extra  
`"  
  in you line of code, you will also need to specify the file location in full

See below a working example

If I can help further let me know

Regards
Joe


$remotesystem = "JoeDellXps"
$compname = "\\joedellxps\c$\"

$result = ([WMICLASS]"\\$RemoteSystem\ROOT\CIMV2:win32_process").Create("cmd.exe /c \\$compname\c$\windows\temp\java\jre.exe /s /v /qn")

Open in new window


$result.returnvalue   # should return 0 is successful
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

How to sign a powershell script so you can prevent tampering, and only allow users to run authorised Powershell scripts
This script can help you clean up your user profile database by comparing profiles to Active Directory users in a particular OU, and removing the profiles that don't match.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now