Creating Powershell script for VMWare using veeam - powershell

I am trying to create a script to automate the Veeam backup using PowerShell.
I know in the free version I only have 2 options (Veeamzip and Quick Backup).
I have a Drobo on the network with the share setup and accessible.
I have gone into all the VMWare Hypervisors and created an account with the proper permissions to run a backup.
I am down to creating the syntax for running the backup.
I am confused when I look at their document. I am not sure if I am supposed to use a copy, replication, a backup job, or what.
If I can get the initial syntax to run a backup of one machine I know I can build the script.
Any information would be greatly appreciated.

This can not be done with this version of VMWare.

Related

Red-Gate SQL Compare and Powershell to run CDC script

Does Red-Gate SQL Compare need to be installed on On-Premise Database Server to run powershell scripts that are set for automation? I have Red-Gate on my local machine, and I am asking this question to figure out if i need to install it to server because that will determine if i need to buy another license.
There are subtleties in licensing that are best discussed in person with Redgate Sales. It will depend on whether you are the only user contributing to the database changes and triggering the automation, what 'user' will be running the automated process (is it you, or will it be drive by a service account?) If you contact sales#red-gate.com (or your Redgate account executive) they will be able to advise you on your options.

Terraform GCP: Run PowerShell in Windows instance on create

I have made a simple Terraform manifest that successfully initiates a Windows 2016 instance in GCP. As a next step I would like to execute a Powershell script to further configure and install software in the Windows instance.
I can not for my life find any example on how to execute a remote script through Terraform in a Windows GCP instance. For Linux instances it seems pretty straight forward, but how is it supposed to be done for Windows? Does anyone know any examples?
Any thoughts or ideas are much appreciated, thanks!
I had the same situation one month ago in the Oracle cloud. (I think the process is the same for all cloud providers.)
My situation: I have to run the winrm script to allow the communication from ubuntu to windows 2016 server to run the Ansible playbooks.
You can find the answer below.
https://github.com/terraform-providers/terraform-provider-oci/tree/master/examples/compute/windows.
I put my Powershell script (winrm) in the "userdata" folder and update the same in winrm.tf file. That's it.

Setting up VM in Azure from scratch. How to copy files to VM drive preferably by DSC?

I have a buch of tools that I copy to destination machine in Azure every time I create a new one. How I do it now
zip folder with tools
open powershell session
use Copy-Item -toSession
unzip
This somewhat works. However, it's not ideal - e.g. update of one tool is not as easy as it should be.
I would like to add this to PowerShell DSC configuration. Tried to find something like that and every File resource I found so far uses network shares.
Q: Is there any oficial way how to achieve the same result?
Q: If not, any sensible way how to achieve this? DSC was my first choice, but is not mandatory.
I find this as basic requirement a would expect that this will be one of scenarios that people try to solve.
Note1: I use DSC in push mode.
Note2: We were trying ansible to cover whole process (VM creation, LB, NSG, VPN, ..., VM setp - registry, FW, ..)), but found out that not everything in Azure is possible with ansible (IIRC gateways, vpns, ..)

How to run powershell script remotely using chef?

I have powershell script which is present on chef server to run on remote windows server, how can i run this powershell script from chef server on remote windows server.
Chef doesn't do anything like this. First, Chef Server can never remotely access servers directly, all it does is stores data. Second, Chef doesn't really do "run a thing in a place right now". We offer workstation tools like knife ssh and knife winrm as simplistic wrappers but they aren't made for anything complex. The Chef-y way to do this would be to make a recipe and run your script using the the powershell_script resource.
Does it mean chef is also running on Windows server ?
If yes, why not to use psexec from Windows Ps tools ?
https://learn.microsoft.com/en-us/sysinternals/downloads/psexec
Here is my understanding of what you are trying to achieve. If I'm wrong then please correct me in a comment and I will update my answer.
You have a powershell script that you need to run on a specific server or set of servers.
It would be convenient to have a central management solution for running this script instead of logging into each server and running it manually.
Ergo you either need to run this script in many places when a condition isn't filled, such as a file is missing, or you need to run this script often, or you need this script to be run with a certain timing in regards to other processes you have going on.
Without knowing precisely what you're trying to achieve with your script the best solution I know of is to write a cookbook and do one of the following
If your script is complex place it in your cookbook/files folder (assuming the script will be identical on all computers it runs on) or in your cookbook/templates folder (if you will need to inject information into it at write time). You can then write the .ps file to the local computer during a Chef converge with the following code snippet. After you write it to disk you will also have to call it with one of the commands in the next bullet.
Monomorphic file:
cookbook_file '<destination>' do
source '<filename.ps>'
<other options>
end
Options can be found at https://docs.chef.io/resource_cookbook_file.html
Polymorphic file:
template '<destination>' do
source '<template.ps.erb>'
variables {<hash of variables and values>}
<other options>
end
Options can be found at https://docs.chef.io/resource_template.html
If your script is a simple one-liner you can instead use powershell_script, powershell_out! or execute. powershell_out! has all the same options and features as the shell_out! command and the added advantage that your converge will pause until it receives an exit status for the command, if that is desirable. The documentation on using it is a bit more spotty though so spend time experimenting with it and googling.
https://docs.chef.io/resource_powershell_script.html
https://docs.chef.io/resource_execute.html
Which ever option you end up going with you will probably want to guard your resource with conditions on when it should not run, such as when a file already exists, a registry key is set or what ever else your script changes that you can use. If you truly want the script to execute every single converge then you can skip this step, but that is a code smell and I urge you to reconsider your plans.
https://docs.chef.io/resource_common.html#guards
It's important to note that this is not an exhaustive list of how to run a powershell script on your nodes, just a collection of common patterns I've seen.
Hope this helped.

Recover cron jobs through file structure

One of the drives on my server recently gave out and corrupted the OS. I was able to restore all the files, but now I have a backup drive with just the file system; not bootable. I'm setting up a new server now, and need to setup the old cron jobs. Is there a way to look through the file structure to see all cron jobs that were setup on the old server? Server was CentOS, not sure of version. Thanks in advance!
Crontabs belonging to individual users should be found in
/var/spool/cron/##USERNAME##
Whereas the server-wide crontab should be in
/etc/crontab