Poweroff / poweron VM via the powerCLI script
Hello
Is it possible to script a poweroff OWN for all my VM on a cluster (RedHat and Windows). Ditto for the ignition.
If YES, can you give me the lines in the batch
THX
Yes, this triggers a stop through the guest OS.
For a cluster, you could do
Get-Cluster -Name| Get-VM | Shutdown-VMGuest -Confirm:$false
____________
Blog: LucD notes
Twitter: lucd22
Tags: VMware
Similar Questions
-
How to enable and disable, copy or rename the rules via the groovy script?
A client, we received this question:
How to enable and disable, copy or rename the rules via the groovy script?
Foglight 5.7.5
Hello
There is this example of support KB
support.Software.Dell.com/.../99059
and there is also documentation of Service layer of the administration on the RuleService console.
Best regards
Golan
-
GUI for the PowerCLI scripting
Someone knows a software or tool that generate the GUI for the PowerCLI scripting?
There are a few, Sapien is free and it's called PrimalForms Community Edition.
-
Call via the FDM script batch file
Hi all
Here is the FDM script written to call the command via the Script FDM in import file, test the operation of the script by creating a vbscript file (* .vbs) to call the batch file and worked like charm. Please see the excerpt from the sciprt
SubMonth = "Mar".
SubYear = "FY15.
ARG = trim (SubYear) & "" & trim (SubMonth)
Set objWshShell = CreateObject ("Wscript.Shell")
strCmd = "E:\hyperionfiles\batch\CalcActNew.bat" & Arg
Line 53 objWshShell.Run 'strCmd', 0, True
The error returned is
Thank you
Hi, no double quotes are needed to join strCmd it's a variable
objWshShell.Run strCmd, 0, True
-
BASH command via the console script
All,
I had to run a a series of BASH commands via the Script Console to a subset of servers. Is there a script for this that I can take a look? Or direct me to the controls, I might need.
You need to encapsulate in a script on the remote host to do.
actSvc = server["ActionService"]params = [:]params.put("COMMAND_LINE","/home/foglight/testBashScript.sh")params.put("HostName","centosvm1")actSvc.invoke("RemoteCommandAction",params)
This will run the script shell on the host remote centosvm1
the bash script contains the statement echo inside.
-rwxr-xr-x 1 foglight dba 99 Jan 17, 12:09 testBashScript.sh [foglight@centosvm1 ~] $ testBashScript.sh more
#! / bin/bash
echo 'Test Action of Bash Script remote command execution' > /tmp/ForumOutput.txt
[foglight@centosvm1 ~] $
-rw - r - 1 foglight dba 56 Jan 17, 12:12 ForumOutput.txt [foglight@centosvm1 ~] $ /tmp/ForumOutput.txt more
Run the test of the Action of the remote Script Bash command
[foglight@centosvm1 ~] $
I have tried a few iterations to try to echo the commands directly in a command param file but did not
Hope this helps
-
Collection for the PowerCLI scripting requirements
Someone at - it a good model that helps you organize information, gathering process when you go to the management or to a customer to get for scripts and automation requirements that they want to do? Y at - it a Web page or a book that puts this kind of thing in a structured methodology or at least one practical how to guide?
For example, what kinds of questions should I go to make sure that I understand any of my script is supposed to do and help the management or the customer understand what THEY want to do, and get a consensus agreement on the functional requirements for my powerCLI script?
Your suggestions of entry, welcome masters strategies.
This question is not really unique for PowerCLI scripting, but all scripts/programs, to write (for yourself or for a customer |).
And of course, there are always the classic answer "it depends".
If it is a small task that you write yourself, the requirements are pretty obvious.
Most of the time, you have the requirements in your head, but it does not have to write in schematic form.
When you write for a customer, by definition be more formal (I guess).
An article I like, is the Introduction to gather our creative use cases and requirements published in the Code review.
Take a look.
-
Change the PowerCLI Script to use the DRS and DRS storage
Hello
I have a PowerCLI script that specifies a host and a data store to create a new virtual machine, which has served us well. Now we have activated the DRS and DRS storage and I wonder what to change in order to take advantage of these features. Are there commands to specify a cluster and the cluster data store and let the DRS to decide the initial investment for a new virtual machine? At the moment we put all hosts and the warehouses of data as variables and use them in the line below.
Thank you.
$newVM = New-VM-name $NewVMname - VM $TemplateName Datastore - $datastore - VMHost $vHost - confirm: $false - location $myName
You set a Datastorecluster?
If Yes, then you can replace the value of parameter data with the datastorecluster object store.
Replacing a VMHost with a cluster is not taken in charge I'm afraid.
But you can use something like this
New-VM-name TestVM Datastore - DSC - ResourcePool (Get-Cluster-name mycluster |) Get - Resourcepool - name of resources)
This will automatically select the VMHost.
The virtual machine appears in the root of the cluster.
DSC is the name of a datastorecluster in the cluster mycluster
-
copyright in the powercli script symbol
I need to print the copyright symbol when a powercli script is run.
but,
write-host "Copyright ©" does not print a circle with a 'c' in there
It prints just a 'c '.
no idea how to get this printed on the screen
Strange, who also works for me also, what happens if you use the below:
Write-Host "Copyright $([Char]0169)"
-
XML and the PowerCLI Scripting Edition
Good then I am using PowerCLI to do Automation more boring tasks that need to be repeated. But now I'm stuck because I do not understand how to enter commands in the window PowerCLI and creating XML scripts that are called by a manually scheduled task.
Is there training there or good articles on how to go to the manual entry of orders from command line and in scripts development of really?
Any information would be greatly appreciated.
See you soon,.
Paul
I assume you are talking about PowerShell scripts and not the XML scripts?
You can find a good intro to PowerShell scripts in Chapter 10 of free PowerShell ebookTobias.
-
External authentication via the PHP script failed
I'm not a PHP genius - in fact I'm not a backend coder so I'm kinda struggeling with the sample scripts - I still hope for a sample of CF....
I'm trying to run and connect to the CAA via the command line (Terminal). I'm not sure what I'm doing wrong - this is what I'm passing:
PHP f /Applications/MAMP/htdocs/afcs.php args - debug - host = my_pass, http://connectnow.acrobat.com, fcguru, my_login
The username and password I spend are correct. However, I get this response:
Error: message exception 'AFCSError' with ' < State response 'error' = >
< error code = "AUTH_FAILED" >
< msg > failed authorization < / msg >
< / error >
< / answer >
' in /Applications/MAMP/htdocs/afcs.php:86
Really struggeling with this. Once again I get this working from the command line, I don't know how to call it from a script instead. I use CF on the backend, no PHP.
Kind regards
Stefan
Thank you, this is very useful. It seems that I can now connect from the Terminal so that's a good start. Also, I did not see external authentication in PHP for example - I must have been blind.
I'll see how far I get with that. What I'm trying to do is spawn new rooms based on a template on the fly, and I have some doubts, I'll be able to understand this myself. -
Deployment of the OMB via the TCL script
I need to deploy all of the mappings in a module in a new target database. I want the configuration settings for
(1) default operating mode = "DΘfinir base" and for
(2) default audit level = 'NONE '.
on all maps.
It seems that the default repository for these parameters (and I can't find where these default values can be managed) are
(1) default operating mode = "Line in function from set failover" and
(2) level of auditing by default = "ERROR DETAILS" on all the mappings.
While when I deploy via the script all mappings have these settings (which we do not want) as it appears that OMB orders use these repository/user settings. Card via interface OWB deployment allows you to change the settings of configuration as requires it, but it's the long answer.
These configuration settings can be overridden in the TCL script via OMBDEPLOY or OMBALTER or any other command OMB parameter so all mappings are deployed/configured as
(1) default operating mode = "DΘfinir base" and for
(2) level of auditing by default = 'NONE' on all the mappings.
Thank you
Dave.Hi Dave
Yes, you can set the code generation and the non-use of the properties of mode from a script...
OMBALTER MAPPING "$map" DEFINED the VALUES of PROPERTIES (GENERATION_MODE, DEFAULT_OPERATING_MODE) ("SET_BASED", "SET_BASED")So that you can loop around all the cards and do these things, there are also a few experts on the Exchange utility, allowing you to block of updates quickly
http://www.Oracle.com/technology/products/warehouse/htdocs/experts/multi_config.zipThe model is available from scripts, for example to a PLSQL mapping batch you can query the properties as follows:
OMBDESCRIBE CLASS_DEFINITION 'BATCH_MAPPING' GET PROPERTY_DEFINITIONSSee you soon
David -
Export of the metadata of Essbase via the Calc Scripts
Hi guys,.
Here's my problem,
We try to export essbase cube intersections in a flat file (so that it can be used by SUN)
)
We have developed a calc script to export an intersection to a flat file, but the flatfile is written only to the location of the essbase server.
But we need this flat file to immerse in an another server (SUN Server), so what would you suggest is the best way to do this on a regular basis (monthly) and huge amounts of data.
PS: Someone suggested me to use a windows batch file to move the flatfile, but I have no idea how to do that.
Any help would be really appreciated...
Thanks in advance
ArunMetadata? You mean, right? DATAEXPORT is only going to write the numbers, not of dimensionality.
I did deal with this issue, so - DATAEXPORT wrote only the box to Essbase. You can try pointing to mapped drives, but it has not worked for me.
Why not put together a script MaxL who runs the calc script (standard stuff so far) and then either the caller script in cmd OS either copy it to another location (if on Windows, see COPY) or use the MaxL shell command to launch a shell of the operating system and make the copy?
Another solution would be to set up a routine watcher file FTP'd the file off the drive, then did a deletion of the exported file. You may have to wait five minutes, but that shouldn't be a big problem in Informatica. In fact, I bet that informatica can do 99% of it.
Finally, another approach would be to write that all at a table and just picking up here.<--This is="" probably="" the="" easiest="" and="" if="" you="" think="" about="" it,="" what="" informatica="" was="" meant="" for;="" no="" more="" messy="" files="" to="" worry="" about="" and="" it's="" sql="" all="" the="" way.="" i="" would="" do="" a="" truncate="" after="" it="" read="" the="" table="" as="" dataexport="" has="" a="" habit="" of="" concatenating="">--This>
Kind regards
Cameron Lackpour
-
Via the command script / Sudoers question
Hello MacGeniuses.
After trying to understand the solution for my part, I only managed to come up with a partial solution.
Main question:
I want to use an alias of office to shut down the computer. The reason is that I wish to first run another command without having to open a terminal every time.
And also, I don't want to enter a password every time.
Based on my homework, I created a text file, it gave an extension .command, did a chmod + x and then tried to use to run the following commands, both starting with a space to keep them out of the history of the orders:
Echo password | sudo nvram SystemAudioVolume = 80%
Echo password | sudo shutdown-h now
The commands work fine if I already have a sudo in terminal of this session. If I don't then I'm invited my password.
I even tried to add me in the sudoers file (in the last line) but that did not help:
Steve ALL = (ALL) NOPASSWD: / sbin/poweroff, /sbinreboot, / sbin/shutdown, / usr/sbin/nvram
When it comes to Linux type stuff, I am just a monkey-see, monkey-do person, so if you give me good advice, I can come back with a response like, "What is a power cord?" Please be as gentle as possible.
Secondary issue:
Everytime I open terminal I get a list of stuff like indicated below (there are several, I just cut and paste one of them). Anyone know how to stop this?
[Restored 22 July 2016, 20:54:32]
Last login: Friday, July 22, 20:53:18 on ttys000
Session restore: Fri Jul 22 20:53:56 EDT 2016
Steves - iMac:Desktop Steve$ chmod + x Shutdown.command
Steves-output iMac:Desktop Steve$
Logout
Saving session...
.. .saving story... truncate the history files...
... done.
[Process]
There is a way. It is NOT the only way.
Google "ssh passwordles".
Set up your account without password ssh logins.
Now, take the ~/.ssh/id_*.pub file and put the contents of the file in the "/var/root/.ssh/authorized_keys of the root file (you will need to use sudo to perform this change)."
The id_*.pub file will probably be id_dsa.pub or id_rsa.pub, but it could be slightly different.
Now, you can
SSH root@localhost shutdown-h now
and you will not have a password.
NOTE: Make sure your id_ * (not the .pub file), which is your private key NEVER leaves your control and copies are not where someone else can get his hands on it. If someone else gets your id_ file *, they can connect to your system with a password.
NOTE 2: There are ways to put a password your ssh keys and store them in your keychian. Google: "ssh password in keychain". It would be safer than no password, but you will still need to keep control of your keychain file. It's always something
-
Cannot remove index via the transformation script custom
I want to remove through the Custom transformation script a clue, in the relational model.
Le script runs without error by only the index is not deleted- tables = model.getTableSet () .toArray ();
- for (var t = 0; t < tables.length; t ++) {}
- table = table [t];
- table.setDirty (true);
- constlist = table.getKeys ();
- for (var i = 0; i < constlist.length; i ++) {}
- constraint = constlist [i];
- constraint.setDirty (true);
- indname = constraint.getName () + "_IX";
- {if (Constraint.isFK ())}
- index = table.getIndexes () .getByName (indname);
- index = table.getObject (indname);
- If (index! = null) {}
- index.setDirty (true);
- {if (index. GetName(). Equals (indname))}
- the index. Remove;
- }
- }
- }
- }
- }
Hello
If you use "debug", probably you will see some of the problems you have.
line 16 - index.remove;
be - index.remove ();
but you can't get there because you're wrong check:
{if (Constraint.isFK ())}
must be:
{if (!) {(Constraint.isFK ())}
other problems:
(1) 4th place will put all the paintings as dirty
table.setDirty (true);
This should be moved after the removal of the index
(2) the same for the constraint - you define constraints like salty, BTW, it is not necessary define elements of array as dirty, if the table is / will be defined as dirty.
Script could be dangerous - make your tests on the copy of the drawing or model. Versioning can help here - after running the script and save the drawing, you can see in the outgoing changes (subject to a window changes) exactly what is changed by this script and probably undo the changes if you don't like them.
Philippe
-
Import Excel to use with the PowerCLI script file
I would try to ingest the VMware Hardening guide Excel file and then use it to run a script on some columns as column "configuration setting.
If I can get the "Configuration parameter'"desired value""Default value"and"ID of the guideline"a powershell script, it would be easy from there.
Someone did he do something like that or it can crack in Powershell?
If you save the HG as XLSX file, just open the XLS and save under a XLSX in Excel, you can use the function import - Excel of Finke.
How to install and use is described on the Github page.
So is boils down to
Import-Excel vSphere_6_0_Hardening_Guide_GA_15_Jun_2015.xlsx |
Select "Configuration parameter', 'Value', 'Default value',"Orientation Id"
Maybe you are looking for
-
Low replacement MacBook in 2016
Hey! So, I just bought a used MacBook (2010) with almost completely gone rubber of the bottom plate, and I noticed that Apple has a background of MacBook replacement program where they swap the bottom plate for free. Can I use this program to get fre
-
TL 938 G wifi direct support or not?
I see on wifi alliance tl 938g is certified for direct wifi but I force found how how it works. Is there this function?
-
Hello, I am interested L555-11U and L555 - 11L. When available these models in Spain?Thank you.
-
Photos: drag and share photos in a calendar layout
I do the annual family calendar and it seems that in the Photos you can not drag and share pictures in the fields more. It's very frustrating when you have to remove all of them and then find them in the bar of the photo and then replace them. You
-
What is the sd card to mirco bigggest that you can use in 2 Thinkpad