Running Powershell as remote command
We lack 5.4.1 I thought I was supposed to run Powershell commands natively, but the only option I see is to run VBscript. Did everyone not just encapsulates their orders of Pwershell in a VBscript?
Jom,
vCM 5.4.1 support the dataclass custom Windows PowerShell information. To access it, you must create a custom information (Win) filter.
Thank you
John
Tags: VMware
Similar Questions
-
Run remote commands like gpuvm and pcoip-ctrl
Hi, I am a total beginner powercli, so please tell me if this is the wrong direction completely. I run a few servers ESXi 5 with Nvidia grid K1 and Teradici Apex 2800 cards in them. There are a few commands that I can run when you are connected to the host via putty that I would like to be able to remotely run instead. I have connected to my hosts via powercli and it seems that it is set only to run the specific commands that are embedded in the program. Is it possible to run these other remote controls that would work from the console for ESXi?
Maybe this plugin can be useful:
Before VMware experience: [UPDATE] esxcli plugin to run commands shell (new version)
-
Remote command fails when cross Foglight, but ok using command line
Try to perform an action simple remote command when a rule triggers the file /sharedScripts of monitoring system. When the alarm is triggered, an email is sent and action of remote command to find and remove the logs more than 10 days is supposed to work.
The command to run is:
find/sharedScripts/set - name "* .log" \ (-type f-mtime + 10 \)-exec rm {} \;) ""
This command works well from the command line on the server, but when it is run by a remote control action, we get the following exception:
2015-07-20 19:04:30.556 WARN [Action-4-wire-3856] com.quest.nitro.service.action.impl.command.RemoteCommandAction - the remote execution failed on the host prod - 108.llbean.com for the command "find/sharedScripts/set - name" * .log "------(-type f-mtime + 10 \)-exec rm {}------;)" "with the following error: 1.»
I tried many iterations of escape characters, single/double quotes, etc...
Has anyone else tried something like this? I understand that I could create a script that has this command in it, but if I can avoid that I would because a similar process will be implemented through a hundred servers with different commands according to the system of files in place. In this regard, I would like to manage everything centrally if I can.
Hi Golan-
Thanks for the reply. I got a response back from support today and it turns out that some avoidance that is required to run the command from the command line has been the cause of the problem running like a remote control action.
This command works well on the command line:
find/sharedScripts/set - name "* .log" \ (-type f-mtime + 10 \)-exec rm {} \;) ""
but the avoidance of parentheses problem in Foglight. The following seems to work as a remote command:
find/sharedScripts/set - name "* .log"(-type f-mtime+10)-exec rm {} \; "."
-
See Planner 3.0.1 - test questions running simple-VM-remote-RDP
Hello
I am trying to run the remote RDP Single-VM test according to the instructions of Installation and user's Guide.
When I start this test, the client virtual machine console turns off completely and I'm unable to see if any operation is going on.
Also 'viewplanner.log' shows "connection started from the client: fe80::457f:815 c: a8b6:317% 13" message and I see no progress after that. "
Everyone met such a problem? Any ideas?
Copied a part of the viewplanner.log below.
Thank you
Subhish
2014-09-30 11:01:31, 896 INFO Operation: poweron_desktops, start time: killing Sep 30 11:01:29 2014, Total time: 2.15
2014-09-30 11:01:31, 896 INFO Operation: poweron_clients, start time: killing Sep 30 11:01:30 2014, Total time: 2.21
2014-09-30 11:01:31, 896 DEBUG creating 1 users and adding to the security AD Group: Test
2014-09-30 11:01:31, 897 INFO-
2014-09-30 11:01:31, 897 INFO waiting for the number of virtual machines for you sign up
2014-09-30 11:01:31, 898 NEWS-
2014 09-30 11:01:31, INFO 904 got the domain Netbios name: SSRBRM
2014-09-30 11:01:31, 907 DEBUG add users ['Test_1'] for security AD Group: Test
2014-09-30 11:01:31, 916 DEBUG all users added to AD security group: Test
2014-09-30 11:01:34, 287 DEBUG returning to the current state: 0 with status message: [IP recorded: desktop: 0, Clients: 0] [the workload began on machines 0] [Uploaded results-> desktop: 0 (0 errors), Clients: 0]
2014-09-30 11:02:17, registration of new customer INFORMATION 349: 192.168.100.14
2014-09-30 11:02:17, 350 registered current INFO status machines: [pairs required: 1] [clients: 1] [server: 0]
2014-09-30 11:02:19, 287 DEBUG returning to the current state: 0 with status message: [IP recorded: desktop: 0, Clients: 1] [the workload began on machines 0] [Uploaded results-> desktop: 0 (0 errors), Clients: 0]
2014-09-30 11:02:56, 466 record a new INFORMATION server: 192.168.100.13
2014-09-30 11:02:56, 467 registered current INFO status machines: [pairs required: 1] [clients: 1] [server: 1]
2014-09-30 11:02:56, 467 INFO receives the IP address for the computer virtual GoldenDesktop VC
2014-09-30 11:02:59, 297 DEBUG returning to the current state: 0 with status message: [IP recorded: desktop computers: 1, customers: 1] [the workload began on machines 0] [Uploaded results-> desktop: 0 (0 errors), Clients: 0]
2014-09-30 11:03:06, 482 INFO receives the IP address for the computer virtual GoldenClient VC
2014-09-30 11:03:06, 497 INFO Got, the IP address for the virtual GoldenClient computer: 192.168.100.14
2014-09-30 11:03:06, 498 INFO receives the IP address for the computer virtual GoldenDesktop VC
2014-09-30 11:03:16, 508 INFO on hold until that all IP addresses have been resolved
2014 09-30 11:03:26, INFO 514 receives the IP address for the computer virtual GoldenDesktop VC
2014-09-30 11:03:26, 529 INFO Got, the IP address for the virtual GoldenDesktop computer: 192.168.100.13
2014-09-30 11:03:26, 530 DEBUG IP: 192.168.100.13-> name: GoldenDesktop
2014-09-30 11:03:26, 530 DEBUG IP: 192.168.100.14-> name: GoldenClient
2014-09-30 11:03:26, 530 INFO Running query: SELECT * from hostinfo where IPADDR = "192.168.100.13."
2014-09-30 11:03:26, 532 INFO Running query: UPDATE SET is_Client = '0' hostinfo, State is 'Unpaired', name = 'GoldenDesktop' where IPADDR = "192.168.100.13."
2014-09-30 11:03:26, 610 INFO Running query: SELECT * from hostinfo where IPADDR = "192.168.100.14."
2014-09-30 11:03:26, 611 INFO Running query: UPDATE SET is_Client = '1' hostinfo, State is 'Unpaired', name = 'GoldenClient' where IPADDR = "192.168.100.14."
2014-09-30 11:03:26, 622 INFO registration remaining VMs
2014-09-30 11:03:26, 622 threshold of INFORMATION gathered for the number of machines... The plan of starting reference...
2014-09-30 11:03:26, 622 INFO waiting for virtual machines to settle and sleep during the time scale
2014-09-30 11:03:56, 622 assignment of client-server INFORMATION for 1 pair
2014-09-30 11:03:56, 623 INFO Running query: UPDATE hostinfo SET state = 'Matched' where IPADDR = "192.168.100.14."
2014-09-30 11:03:56, 687 INFO Running query: UPDATE hostinfo SET state = 'Matched' where IPADDR = "192.168.100.13."
2014-09-30 11:03:56, 697 INFO Running query: INSERT INTO testinfo (test_name, ClientIP_FK, ServerIP_FK, Protocol, username, password, test_state, start_time, type) values "Sinlge-VM-remote-RDP ()', '192.168.100.14', '192.16.
(8.100.13', 'RDP', 'Test_1', "passw0rd", "waiting", '2014-09-30 11:03:56 ', 2)
2014-09-30 11:03:56, 708 INFO Running query: SELECT * from testinfo where testname = 'Sinlge-VM-remote-RDP' and test_state = 'pending' and ClientIP_FK = '192.168.100.14' and ServerIP_FK = '192.168.100.13. '
2014-09-30 11:03:56, 710 INFO-
2014-09-30 11:03:56, 710 INFO launch the execution plan for the run profile
2014-09-30 11:03:56, 710 INFO-
2014-09-30 11:03:56, 721 DEBUG begins to gather statistics periodically VC...
2014-09-30 11:04:03, INFO 549 from the workload for all assigned pairs...
2014-09-30 11:04:03, 549 INFO remote command running on 192.168.100.13 machine: Logoff
2014 09-30 11:04:03, 674 INFO command run on the remote computer: Logoff
2014-09-30 11:04:03, 751 INFO wait until all desktop computers have disconnected
2014-09-30 11:04:08, 749 continuous INFO race after waiting
2014-09-30 11:04:08, 749 INFO Running query: UPDATE hostinfo SET state = 'Busy' where IPADDR = "192.168.100.14."
2014-09-30 11:04:08, 827 INFO Running query: UPDATE hostinfo SET state = 'Busy' where IPADDR = "192.168.100.13."
2014-09-30 11:04:08, 845 INFO Running query: UPDATE testinfo test_name SET = "Sinlge-VM-remote-RDP", Protocol = "RDP", username is 'SSRBRM\Test_1', password = 'Q1w2e3r4!', test_state = 'Running', start_time = "2014-09-30 1.
' 01: 04:03 "where test_id = 6
2014-09-30 11:04:08, 856 INFO running commands remotely with args: customer: 192.168.100.14, server: 192.168.100.13, Protocol: RDP, test_name: Sinlge-VM-remote-RDP, vmuser: SSRBRM\Test_1, vmpasswd: Q1w2e3r4!, workprofile: {'IEbpm': 1 L,}
{"ARbpm": 1 L, "Thinktime": 2 L, 'name': 'StandardBenchmarkProfile_1i', 'hosttime': 1, 'random': 1, 'iterations': 1 L, 'OMP': 60 L, 'video': 2 L, 'applist': ' WORD, ACROBAT, IE_APACHEDOC, EXCEL_SORT, 7ZIP, PPT, FIREFOX, OUTLOOK, IE_WEBALBUM, VIDEO '}, p
oolname: None, domainname: None
2014-09-30 11:04:08, 857 INFO adding the callback function for the remote root object to ipaddr: 192.168.100.14
2014-09-30 11:04:09, 298 INFO added reminder for the command startWorkload on the client 192.168.100.14
2014-09-30 11:04:43, 161 NEWS connection started from the client: fe80::457f:815 c: a8b6:317% 13
Couple of fixes and testing is currently underway with success.
-The version of Adobe Reader must be v9 or v10. I comply v11 and errors.
-For the 'IE_ApacheDoc_BROWSE', run with IE v8. I ran v11 IE on Windows 7 and became the error. When you update the packages on Windows 7, it will update IE to v11, uninstall this update and it should be good. Found this solution on another thread of discussion in this forum.
-
Original title: impossible to copy to Admin$\system32\dwrcs.exe.
I'm using DameWare NT Utilities card remote Commander for remote control a workstation. Other workstation remote control works fine. On the workstation with the fact that I'm having the problem the following message appears:
Cannot copy
C:\Program Files\Dameware Development\Dameware control\DWRCS.exe mini remoteTO
\\workstation-name\ADMIN$\System32\DWRCS.exe
System error: 5
The system message:
Access denied
I don't think it's a matter of DameWare since other workstations are accessible. I think that this could be a Windows problem with a kind of security. Anyone know?
Hello
Your computer is connected to a server, or a domain?
You can follow the steps in this link:
Note: Using third-party software, including hardware drivers can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the use of third-party software can be solved. Software using third party is at your own risk.
Access denied messages when the connection to the remote PC
If your computer is on a domain network, I'd recommend posting your query in the TechNet forums.
Hope the helps of information.
-
Original title: Powershell
My commputer won't allow updates. When I try the blue bar just continues to run. I tried to run Powershell, but it stops and says error has occurred. What should I do
Hello
1 - what you mean that you can not install Windows Update? If Yes, then the updates?
2 are. what Powershell you referring?
3. you receive an error message? If so, then post back the exact error message.
Answering these questions that could help us help you better. The following article could be useful if you are referring to the Windows updates.
Problems with installing updates
http://Windows.Microsoft.com/en-us/Windows-Vista/troubleshoot-problems-with-installing-updates
-
I'm trying to run the sfc/scannow command. but the computer won't let me
How to make a console session
I'm trying to run the sfc/scannow command. but the computer won't let me. He tells me that I need to be an administrator (which I am) and I have to run a session of consul?Go to start | Programs | Accessories and right click on the command prompt, and then select run as administrator. It's a console session.
Steve
-
View the programs that are running on the remote computer.
How use remote desktop to view the programs that are running on the remote computer. I connect to the pc remotely is used to monitor a communication system for the alarms. The alarm Viewer application runs as a service. When I connect locally to the computer, I can see the application and view the status of the alarm system. When I connect via remote desktop, I can't. I don't see that the application is running in the services list.
Do you mean the Task Manager?
If so, try using
change sequence to bring up the Task Manager while in the session remote desktop active... http://Windows.Microsoft.com/en-us/Windows7/keyboard-shortcuts
You might also find something in the PsTools collection...
-
Struggling to run Powershell scripts / commands
Hi all!
I'm fighting to get the Powershell vCO workflow. I think I missed something really obvious, but I can't see it...
I did the set Kerberos in place on the line of my vCO 5.5.2 machine. I added a Powershell v2 host using VMWare provided Powershell 1.0.4 workflows plugin install, Kerberos authentication and using a shared account (mine, I know that I am an admin on Windows Server). I assured the Kerberos authentication and unencrypted traffic is accepted on the Powershell host. If I validate the object created at the CVO, he says it's fine.
When I come to run another VMware provided workflow, I get responses to error because the workflow doesn't seem to be properly trained, or I get a null response. When I run a workflow, I can see my account by logging in the Windows Server 2008 security log, so I'm pretty confident that the basic connection and portions of Kerberos are all ok.
I just tried to simplify a VMware provided workflow, to make it as a possible base (code below). I always get a Null response. Anyone have any ideas why? Or did someone is able to provide the code for a very simple Powershell-based workflow that they know works so I can test it on my set up?
The VMWare-based simple powershell script provided one to get the contents of some directories and the values that I use - it returns null:
the hostentry, type: PowerShell:PowerShellHost, value: < myPowershellHostSelectedFromPluginManually >
Directoryentry, type: String, value: I manually enter $home. Or C:. Or C:\Windows. Or any other directory I know there is that my user account has no light problem.
output of the result, type: string, value: regardless of the ("DIR" + directory) output >
var Sess;
connect to the host
Sess = host.openSession)
Send the command in powershell
sess.addCommandFromString ("dir" + directory)
invoke the command
invResult = sess.invokePipeline ();
get the result
Result = invResult.getResults)
Send to open a session
System.log ("Result is" + result)
Thank you very much in advance!
And there we go... Who sets: powershell.exe wasn't in the path of the Windows host!
Thanks for the help everyone, especially igaydajiev for giving me the pointer of the final to my answer!
-
I'm trying to run a powershell script of a scheduled task in Windows 2012. The script calls the commands ESXCLI and ends with success (exporting to a CSV file) but the file has no data inside. If I run the script manually without the scheduled task file has all the I expect to exit.
I wonder if there is a framework with Powershell or a PSSnapin I need to add to the script for it to run via a scheduled task. Has anyone done this before with the ESXCLI commands?
panhvr - you may to something. The process account that I use to run this script has only read-only access in vCenter. I logged on the server I am running these reports with the process ID and tried to run the script. He gave me errors indicating permission to perform the operations of esxcli was denied.
I think we found the culprit! I'll have this process ID in vCenter rights upward.
Thank you all!
-
Run a remote command on a virtual machine
I have a remote application that generated virtual machines by request. After that each machine is generated and custom, I need to run a command-line on this machine (machine all have Windows OS installed) of the application itself.
Is there a way to do it through the java/vsphere API? (The machine is running on)
Thank you
the vSphere API does not provide capabilities to execute commands within the guestOS which is what uses the SDK for Java (VMware Tech Preview of Java SDK) and VI (Version of Steve Jin).
However, VMware has an another API that is available for the management of comments called VIX API. This API allows you to perform operations within the guest, transfer files to/from host, etc. There is even a project open source similar to that of VI Java API called Toolkit Java VIX you could look in - http://sourceforge.net/projects/vixjava/
=========================================================================
William Lam
VMware vExpert 2009,2010
VMware scripts and resources at: http://www.virtuallyghetto.com/
Introduction to the vMA (tips/tricks)
Getting started with vSphere SDK for Perl
VMware Code Central - Scripts/code samples for developers and administrators
If you find this information useful, please give points to "correct" or "useful".
-
Question about the use of OdiOSCommand to run remote commands
Hi all
I have a query on OdiOSCommand
I have two following servers.
A server running and odi agent
Server B agent running odi - but no a pots to odi - and odiparams.sh set up correctly.
Now I regularly invoke scripts on server B (using startscen.sh) that use the agent on the server. It works fine - once odiparams.sh is correctly set up for standards etc.
Now I have a new scenario that has an order of OdiOSCommand. Yet once again, I invoke the script from Server B, to use the agent on the server. The OdiOSCommand passes just a shell script, and there is no problem of permission.
I expect the command to execute on the server where the agent is running (e.g., Server A) - but its execution on the server where I invoke the script (IE Server B). I can prove it by temporarily replacing the calling script with a mkdir test_dir schell.
Is it possible in odi to invoke a command on a remote linux server - when the remote server is running an odi agent. I know there are other ways to do this - ssh etc. - but I try to keep this reality to a package of odi of maintainability.
Thanks for the research!This thread responds to what you are looking for:
Re: Startscen using an existing running agent could processBasically, startscen.sh branches off to a local agent on server B, and so the script also runs on server B.
You must use startcmd.sh instead. -
How to run the powershell script of command with several parameters
Is there a way to run a powershell script from the dialog box run with several parameters? In addition, the path to the script contains spaces, for example, c:\powershell scripts\script.ps1.
Take a look at http://www.powershell.nu/2009/12/16/running-scripts-with-arguments-in-powershell/ which explains how to pass arguments to a script.
André
-
Running Powershell since an external program and rename files
Hello
I'm new to powershell, I want to run a script powershell from another program. The program is 12d (this is a civil engineering program). It executes files .cmd and .bat as shell command files (I did successfully already). I am sure that you can also write powershell commands.
Can I create .ps1 files. As a previous post, I want to rename the files (insert text in the middle of the file name - number of files not defined). Use the following statement? Also what other statements should I insert in the powerscript file.
Get-Item. \ *. * | ForEach-Object {Rename-Item $_ ($_.)} (Nom: remplacer "copie de", "")}
http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-windows_programs/cmd-insert-text-into-the-middle-of-the-file-name/63b25adc-C257-4064-b71a-3aac2c8cf11c
Thank you for your help
This issue is beyond the scope of this site and must be placed on Technet or MSDN
-
How to run on the remote server oracle dbv
Hello
I have oracle guard data and I want to run the dbv on the primary backup server using ssh.
I could copy to the standby server and issue a command to run the main exit and collect in/tmp/output9. But it does not log files.
/usr/Oracle/product/11.2.0.2/bin/DBV file = / usr/oracle/oradata/data004/DBA1/DBA1. TEST2_DATA.1 blocksize = 8192 feedback = 640 logfile = / tmp/output9
I also send the command run primary using the ssh to forward a string and run the day before. But no result
SSH [email protected] ' /usr/oracle/product/11.2.0.2/bin/dbv file = / usr/oracle/oradata/data004/DBA1/DBA1.» TEST2_DATA.1 blocksize = 8192 feedback = 640 logfile = / tmp/output9
Thanks in advance
Can't say much more, but it works for me... I just ran this now and this is the result.
Is your ORACLE_HOME defined correctly... should start with a slash. IE /usr/oracle/product/11.2.0.2 (typo in my initial response).
SSH username@hostname "export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1; /U01/app/Oracle/product/11.2.0/Db_1/bin/DBV file=/u02/oradata/xxxx/qradar.dbf logfile = / tmp/xx blocksize = 8192 feedback = 640 "
username@hostname's password:
DBVERIFY: Release 11.2.0.3.0 - Production on Fri Oct 24 15:10:07 2014
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
..........
On the remote host:
username@hostname:/export/home/username: # > cat /tmp/xx.txt
DBVERIFY: Release 11.2.0.3.0 - Production on Fri Oct 24 15:10:07 2014
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
DBVERIFY - verification starting: FILE = /u02/oradata/xxxxx/qradar.dbf
DBVERIFY - verification complete
Total Pages examined: 6400
Total number of Pages processed (data): 0
Total Pages failing (data): 0
Total number of Pages processed (Index): 0
Total Pages failing (Index): 0
Total number of Pages processed (other): 8
Total number of Pages processed (Seg): 0
Total Pages failing (Seg): 0
Total Pages empty: 6392
Total Pages marked corrupt: 0
Total Pages influx: 0
Total Pages encrypted: 0
More high block YVERT: 3445438279 (2.3445438279)
Maybe you are looking for
-
Hello world I'm looking for Compaq CQ60 - 116EE XPDrivers Any help is appreciated Thanks in advance
-
I gave you the basic information. My screen is messed up since I installed version 4. The location of the lines changes while I'm typing, or I change pages. And also the areas get blackened, as I move the cursor.
-
Usually, I close the Firefox window before turning off the computer (Windows XP sp2), but sometimes, for example when power fails, trying to shut down the computer in a hurry, while FF is still open, but no Web site is open. The program then ends and
-
[Bug]? LabVIEW 2010 SP1 - Device Drivers Incorrect link
Hello This page link to download LabVIEW 2010 SP1 Device Drivers Feb 2011 on this page points actually to November 2010. See you soon -JG
-
How can I fix the error code not 32 bit file extension trying to download itunes?
uninstalled itunes and now can't reinstall Guard giving error code 32-bit file extension. Have treid all that I can think of, can someone help please?