Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...I have been a grateful member of this site for several years. I love this site and refer everyone to it!..."

Geography

Where in the world do Tek-Tips members come from?
DarkOne72 (TechnicalUser)
8 Jun 12 7:59
Hello,

Maybe someone can assist me in getting this script to work.
What I want this to do is when ran it will read a list of computers from a text file "computers.txt" and invoke/run a file from a shared location and install it on those machines listed in the text file.

CODE -->

$cred = get-credential $exe = "\\jashare1\IT\CitrixOnlinePluginWeb.exe" $computers = get-content "C:\Scripts\Computers.txt" foreach($computer in $computers) { Invoke-WmiMethod -Name Create -Class Win32_Process -Namespace root\cimv2 -ArgumentList $exe -credential $cred -ComputerName $computer | out-null }

thanks in advance
58sniper (MIS)
8 Jun 12 23:11
Are you getting errors? What is the output when you run it?

Do you have your Tek-Tips.com Swag ? I've got mine!

Stop by the new Tek-Tips group at LinkedIn.

DarkOne72 (TechnicalUser)
11 Jun 12 7:51
I run it and it prompts for the credentials (a popup window with username and password) to which I supply and acts liek it runs but nothing happens.
It never installs but says DONE.
The credentials are correct and an administrator.
58sniper (MIS)
11 Jun 12 20:27
If you run the Invoke-WMIMethod line manually, does it work?

Do you have your Tek-Tips.com Swag ? I've got mine!

Stop by the new Tek-Tips group at LinkedIn.

DarkOne72 (TechnicalUser)
12 Jun 12 6:55
It says "Executing Script" for about 3 seconds then says "Script Execution Completed."
So it doesn't error out but it doesn't DO anything either.
58sniper (MIS)
14 Jun 12 16:34
Remove the

CODE --> PowerShell

| Out-Null
from the end and run just that one line again.

Do you have your Tek-Tips.com Swag ? I've got mine!

Stop by the new Tek-Tips group at LinkedIn.

DarkOne72 (TechnicalUser)
15 Jun 12 7:29
I get this after removing the |Out Null:
__SERVER :
__NAMESPACE :
__PATH :
ProcessId :
ReturnValue : 2


Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close