VMware Converter Automation - powershell

I am looking for a way to automate a conversion process of true image backup (.tib) files to Virtual Machines. I have been looking around VMware for a way to implement this but have left myself really unsure of what I would need.
The reason for this is that I have a bunch of these files that I would like to check to see if they are valid. I would like an automated way to grab these files, convert them, start them up, and then shut them down. I currently have everything set up, I am just lost for a way to actually convert these files.
The two closest solutions that I have found so far are these:
VMware vSphere Essentials Kit
From my understanding (please correct me if I am wrong) I would be able to use PowerCLI to automate a way to convert these .tib files to VMs, but the catch is that I would need a VMware server or ESXi to do so. This seems to provide the ESXi that would be needed to do that.
VMware vCenter Converter
Again, from my understanding (please correct me if I am wrong) I would be able to use this to convert the files to VMs. I have downloaded this before just to use the GUI and it seems to work up until i get to the point where it asks me for the name of the server that I would like to use. I see that there is an option to "Buy Now" on the webpage, but it just takes me to (what seems like) a products page. I figured that the buy now option would be the solution to my server issue there. My thoughts to using this would be to use the API to automate what I need.
My official questions are:
I must not be the first person to want an automated way to convert these files over for testing. Does anyone have any ideas/past experiences to share?
Has anyone used either of these options before?
Are my assumptions correct in thinking that I need a VMware server or ESXi to convert these files?
Would I be able to use the API method that I mentioned above?

VMware vCenter Converter has its own SOAP/WebServices based API.
SDK can be found at https://www.vmware.com/support/developer/converter-sdk/
So you can automate any task basically, using a programming language which is capable to work with WebServices

Related

Password protection of autocad dvb files

I work in a construction projects company developing autocad tools, mostly with the integrated vba editor.
The company wants to keep the developed dvb files stay inside the company, or somehow make them useless when they are carried outside.
So, I know that be password protecting the created dvb files, the code can be hidden (Although after 5 min of google search I discovered that it is trivial to unlock them.) I am trying to find a way that the developed vba files will be used and executed in office, however their codes will be hidden and the employees would not be able to use them out of office.
I am not sure if this is possible though. I know that if I develop external exe files I can use several methods(Connect to local server before running, use USB stick key etc..), however I wonder if I can guarentee that the codes I wrote in the AUTOCAD VBA editor will not be seen and can not be used outside office.
Thank you for all the help in advance.
P.S: Using Autocad 2010 on Windows 7 SP1
In short, you cannot completely protect your DVB source files. As you discovered, information on breaking the password protection is readily available and trivial for a tech savvy user to do.
If your goal is to prevent users from just taking the DVB file with them and using it elsewhere (without source modification), you can embed some checks into the code which will cause failure. For example, ping your Domain Controller by name and if no response it returned, stop with an error. This, however, could be removed if someone edited the code (see first point above).
If you do need protection on your source, you don't want to go the DVB (which is VBA code) route. Instead you will want to develop a true plugin with .NET (which would require a re-write). Of course this isn't foolproof either as .NET code can be easily decompiled to source; however if you run it through a good obfuscator it would make it difficult (but still possible) for even the most dedicated to modify.
In short, there is no way fully protect your source, only make it more difficult for someone to reverse engineer.

I am looking for a way to edit GPO using command line

I am configuring two Windows Server 2008 installations to harden them against attack, and there are tons of services, policies, security options, registry settings, to work on.
I'm looking at powershell, batch files, but no luck though (I was hoping to "automate the commands" without going through the tiring process).
I would be glad if anyone could advise me on this.
I'm assuming you already have enough knowledge in the basic Powershell. You can to use wmi objects with Powershell to achieve your tasks.
Take a look at this handy tool: http://technet.microsoft.com/en-us/library/ff730935.aspx
I would also suggest you to use Server Core if you really want to harden servers against attack.
I had this exact problem, posted here on StackOverflow, looked around more and I found a way of modifying GPO's directly (my implementation via Powershell). Its not pretty, but it IS functional for programmatically modifying GPO's: Using Powershell to edit/modify a GPO

First web server questions

Just looking for some help/suggestions with this. I require my own server for an upcoming project that will be hosting users websites. I want to build a control panel the user can log into and modify their website which will be stored elsewhere on the server. This all seems easy enough, It's just managing domains and emails that confuse me.
What should I look for to manage domain names and point them to the correct website and also what would be the best way to manage email accounts/set up new ones etc. I want to avoid cPanel/WHM if possible, I'm looking to control most things through the control panel I will be building. So any suggestions on this would be useful as well, as I will be wanting to add email accounts through php (Can be done using a shell I assume?).
I will also be wanting to measure bandwidth used on the websites contained in each users directory, any suggestions on making this possible?
I'm really looking for some suggestions on what software to use to set this up, any advice would be really helpful!
Thanks,
Graeme
It sounds like you've got a lot of creative room. May I suggest a web framework? Django. With it you can build out a nice control panel, it's template system is clean and concise. It's also based on Python and thats why I suggest it. If there is a python module for it, you can use it in Django... so things like altering, creating, etc. local data/files is a breeze. you simply us Python (you can even forget it's "django"), crunch your data and then spit it out (into django... out to templates.. to display to the user).
You'll likely want AJAXY biznazz, their is a nice Django App for that, Dajax. Django has a rich and helpful community and tons of resources. Just hop on GitHub.com and search for Django, You'll find tons of stuff.
Im building a DNS Control Panel with it. Which sounds like a minimal version of what you're doing.

How should I create an automated deployment script?

I need to create some way to get a local WAR file deployed on a Linux server. What I have been doing until now is the following process:
Upload WAR using WinSCP.
SSH into server using PuTTY.
Move/Rename/Delete certain files folders to prepare for WAR explosion.
Explode WAR.
Send email notifying users of restart.
Stop Tomcat server.
Use tail to make sure server stopped correctly.
Change symlink to point to exploded WAR.
Start Tomcat.
Use tail to make sure server started correctly.
Send email notifying users of completed restart.
This stuff is all relatively straightforward. And I'm sure there are a million and one different ways to do it. Id like to hear about some options. My first thought was a Bash script. I have very little experience with scripting in general but thought this would be a good way to learn. I would also be interested in doing this with Ruby/Python or something current like this as I have little to no experience with these languages. I think as a young developer, I should definitely get some sort of scripting language under my belt. I may also be interested in some sort of software solution that could do this stuff for me, although I think scripting would be a better way to go for the sake of ease and customizability (I might have just made that word up).
Some actual questions for those that made it this far. What language would you recommend to automate the process I've listed above? Would this be a good opportunity for me to learn Bash/Ruby/Python/something else, or should I simply take the 10 minutes to do this by hand 2-3 times a week? I would think the answer to this is obviously no. Can I automate these things from my computer, or will I need to setup the scripts to run within the Linux server? Is the email something I can automate or am I better off doing that part myself?
More questions will almost certainly come up as I do this so thanks to all in advance.
UPDATE
I should mention, I am using Maven to build the WAR. So if I can do all of this with Maven please let me know.
This might be too heavy duty for your needs, but have you looked at build automation tools such as CruiseControl or Hudson? You might also want to look at Integrity, which is more lightweight and written in Ruby (instead of Java like the other two I mentioned). These tools can do everything you said you needed in your question plus way, way more.
Edit
Since you want this to be more of a learning exercise in scripting languages than a practical solution, here's an idea for you. Instead of manually uploading your WAR each time to your server, set up a Mercurial repository on your server and create a hook (see here, here, and especially here) that executes a Ruby (or ant, or maven) script each time a changeset is pushed from a remote computer (i.e. your local workstation). You would write the script so it does all the action items in your list above. That way, you will get to learn three new things: a distributed version control paradigm, how to customize said tool, and how to write Ruby scripts to interact with your operating system (since your actions are very filesystem heavy).
The most common in my experience is ant, it's worth learning, it's all pretty simple, and very usefull.
You should definately automate it, and you should aim to have it happen in 1 step.
What are you using to build the WAR file itself? There's some advantage to using the same tool for build and deployment. On several projects I've used Ant to build a Java project and deploy it to the servers.

How to build an application on top of PowerShell?

Microsoft seems to be heavily pushing that their server applications (i.e SQL Server 2008, Exchange Server, etc) all have some type of PowerShell integration. The logic makes sense in that one can choose to manage the application from a GUI or CLI.
Therefore if one were to follow that trend and want to build an application that had a PowerShell interface, how would one even start?
Has anyone in the community done this type of thing? If so, what seems to be the best approach?
Update:
The UI needs to have a certain look/feel. Therefore, PowerGUI does not lend itself in this situation. However, I've used PowerGUI and do agree that it can help bridge gaps.
Part of the confusion is really whether or not hosting PowerShell is necessary in order to build an application on top of it. From what I've found, it is not (i.e. Cmdlet's). However, I have not seen anyone really discuss this in the answers yet.
Start here: Writing a Windows PowerShell Host Application
Exchange 2007 admin console hosts PS directly, and surfaces every UI action by showing a ubiquitous "and here's the PowerShell you just asked me to do" UI model). SQL Server 2005 & 8 admin consoles demo the concept of surfacing everything in a UI as scripts as a way of dogfooding scripting abilities (but there is little PowerShell support in SQL Server) (Distinction between Exchange and SQL Server's type of support added in response Shaw's comment, thanks)
PowerScripting podcast has a few interviews on topics like this. Also get-scripting podcast
I attended a PowerShell / MMC 3.0 Devlab at Microsoft a few years ago that taught how to do this very thing. The basic idea was to create the "management functionality" via a series of PowerShell cmdlets in a PSSnapin for your application. CLI oriented folks can just load the snapin and party on your cmdlets directly. For the GUI oriented, you build a MMC snapin that hosts a PowerShell runspace which, in response to GUI actions, executes the appropriate PowerShell cmdlets to tweak the application that is being managed. For bonus points, you display what PowerShell code will be executed by the MMC GUI such that the code can be copied and pasted into a script. There are plenty of examples out on the web that show how to host a PowerShell runspace in your (or the MMC) process and execute PowerShell script in that runspace and get back results.
This is an intriguing idea!
I haven't ever thought about it, and I have no idea if I think it's a good idea, but some creative things could be done.
For example, suppose you have some typical administrative-ish piece of software. Don't really care what, specifically. In a classic app dev't scenario, I'd typically try to generate a list of Command objects (things that'd implement some sort of ICommand), and then my UI would bind to those.
Suppose, now, that you were to instead create a cmdlet for each Command. The UI would more-or-less exist as a friendly interface for the core logic in the suite of cmdlets.
Yeah, ok, nothing new here. People've been doing this for a long time, building up GUIs around command-line tools. I think the key difference is that you'd instead be building up individual command line tools from the concept of the application itself. Heck, it might make more sense for both the application and the cmdlets to reference some shared library of commands instead of making the GUI sit on top of the cmdlets themselves.
Errr- sorry for the scatterbrained response. This answer was pretty much purely stream-of-consciousness. :)
You could try primal forms for building a complete application from a script or you need to build your application with an snappin cmdlets (the previous being what is used by sql, exchange etc.) but link to primail forms here
http://www.primaltools.com/products/info.asp?p=PrimalForms