Automating adding sites to IIS7 - windows

I'm building some scripts for automatically setting up a developer's machine so everyone has an identical setup & configuration.
One thing in particular I want to automate is the configuration in IIS7. We have a bunch of web apps which need to be hosted locally and would ideally like them all set up automatically. Does anyone know of a sensible way to do this?

a little bit of Microsoft.Web.Administration + a bit of LINQPad and you're laughing.

its fairly easy with the powershell snap in
Edit: The MSDN docs are pretty whack as usual, but if you rummage about enough you can eventually find all the commands available to you

Related

Finding PowerShell Cmdlets equivalent to GUI actions

I would like to know where I could find good resources/documentation on configuring a new Windows10 installation using Powershell scripts. I know bash but I'm completely new to Powershell.
When I search google, all I can find about automatically configuring Windows relates to Windows Deployment Services. But I don't have and don't want a Windows Server and simply running a few scripts after each installation is sufficient for me.
I found a few scripts that solve some of the things I want to do:
https://github.com/FlatlanderWoman/winCleaner
https://github.com/hahndorf/Set-Privacy
But for everything else, when I look into the TechNet Library I find it very hard to find anything useful. And when I do find something, it looks outdated:
https://technet.microsoft.com/en-us/library/hh852115.aspx
The problem is: I known the GUI-way of configuring everything I want, but I don't know how to find the corresponding commandlets to do the same with Powershell.
Is there some kind of event listener I could use to find the Cmdlets? Or does anyone have some resources/documentation to recommend? Is the TechNet Library really the established way to find these commands?
Thank you.
Unfortunately PowerShell was only really implemented in Windows 7 (yes I know it was available for XP but not preinstalled) and even then it was kind of like an addon rather than part of the core OS. Windows 8 and 10 have further improved functionality but still for the most part do not use it for their own settings and functions as most home users would have no use for it.
However there is nearly always a way to do whatever you need to, I have a script that configures servers from scratch, renaming the server, installing requisite software and features, copying files, configuring VSS, right down to putting the Computer icon on the desktop. You just have to make a list of everything you want to do, then Google each one.
For example: https://www.google.co.uk/search?q=powershell+put+computer+on+desktop - at time of writing the first result is a TechNet script pointing at a registry key. Tidy as necessary, whack into your build script and move on to the next item.
As of yet there's nothing I've found I've been unable to do with PowerShell, but the vast majority of it has not been directly with cmdlets. There's a lot of registry tweaking and command line stuff like msiexec or schtasks, some COM objects and an awkward Type I had to create and use to set the DNS suffix.
Overall I think it's still easier to do all this in PowerShell than any other scripting language and it's more flexible than premade tools, not because it has so much functionality built-in but because it can access .NET and COM which gives you broad access to all the half-baked stuff MS have wedged in over the years.

Zero deployment CouchDB embedded in a Windows app?

I'm probably dreaming here, but am wondering if there's any possibility of completely embedding a minimal CouchDB engine within a Windows application, such that the app can be run without requiring installation (of CouchDB/Erlang) on the user's computer.
I already provide this slimmed down / bundled ability - check here https://github.com/dch/couchdb/downloads and specifically the lean bundle at 16MiB erlang + all couch love here https://github.com/downloads/dch/couchdb/couchdb-1.1.0+COUCHDB-1152_otp_R14B03_lean.7z
Some brief notes on bundling and embedding couchdb on windows at wiki.apache.org/couchdb/Quirks_on_Windows including how to hide the erlang window (erl.exe -detached) at startup.
Ask on CouchDB #user mailing list if you want more info or help while you have a crack at this.
While not a code solution, you could use one of the bundling applications that can embed files and other files into one executable. One example would be BoxedApp.
Why bother. It is so easy to install Erlang on Windows. Just bundle up the whole thing including the erl.exe binary and have your installer unzip it into a folder. The only thing that you would need to change would be the batch files, or better yet, discard them and write your own batch file to start up CouchDb. Also, it is a good idea to use a different port that either the normal Erlang port (or the usual CouchDB port) and maybe even get Erlang to use localhost as its "shortname".
The CouchDB wiki does provide at least a few tips for Integrating CouchDB into your Windows Applications. YMMV, from what I can tell it's more or less just tips on creating a relocatable build. You'll want to likely generate a solid random admin user/password into the local.ini file during the install process and set up proper permissions on all created databases (to protect against any potential cross-site scripting vulnerabilities) in addition to ensuring the socket binding only happens on the default localhost interface.

Single use only setup for a specific hardware

I am a newbie and not familiar with the setup environments and stuck at some point. I am developing a very simple database application using visual studio 2010. I want to release a demo program and want the demo setup to be executed just one time for a specific computer hardware. For example when one user downloads the demo and installs the setup, the demo setup content, a simple configuration file embedded in the setup or "what so ever I do not know" should be changed, so that setup (when coppied to another computer) could not be used in other computer hardwares.
The sollutions or design ideas for this specific problem should not include any online services checking that the user executes that install or not. All the problem should be solved locally if possible :) and be as generic as possible.
Any design ideas or a starting point
will be very appreciated.
Thanks in advance
This is not possible of course. Whatever breadcrumb you leave to record that the program was ran has to be left on the same machine. Leaving any user with sufficient skills or good enough tools (like SysInternals' ProcMon) to find out where you dropped it and remove it again. Assuming they care enough about making the effort.
The simple solution is to intentionally cripple your demo so that an important feature is missing that would make it useful. Like File + Save. Not just disabled, completely missing in the code as well so hacking the demo program doesn't work either. Easy to do with an #if directive in your source code.

What kind of Tools Exist for Setup Automation in Windows?

I'm looking for some type of solution for getting a window dev environment up and running quickly.
Currently we have a large setup document (50+ pages) for doing an install, and I'd like to automate this process as much as possible. The doc includes things like updating environment variables, installing programs, downloading source code, etc.
I know that the majority of these tasks can be done with a batch script, but that's kind of ugly and a lot of work. And while virtualization would be nice, it is not an option for us.
I'm wondering if anything exists for Windows that would make this less tedious. Something like Ruby's Chef would be great. Does anything like this exist for windows?
Well there is Pkgmgr.exe for unattended installation of windows components if you mix it with a powershell script you should be able to get what you want but it wont be as easy as using Chef. Check here for an example of what you can do with Pkgmgr.exe http://learn.iis.net/page.aspx/133/using-unattended-setup-to-install-iis-70/
System Center is the Microsoft way of pushing out standard desktops. It's quite heavyweight mind you.
You could use VMWare for this. Just create a base machine image, with the necessary stuff installed, and point people at the VM.

How do I make Remote Assistance as painless as possible?

I need to provide remote assistance to the users of my app, through the Internet. I need a reference for doing this, and I need to make the whole connecting to remote desktop process as easy as clicking a menu of my app for my users.
I don't want them to get too involved with the procedure. I believe the built-in remote assistance features of Windows XP and Vista are fine, I just need to make it very simple.
Anyone any ideas?
P.S. A comprehensive reference on the whole Windows Remote Assistance would also be appreciated.
I highly recommend Mikogo. It's free, fast to install and setup, works great, and is very simple. I actually prefer it to the more expensive services ($30-$40/month) because of it's simplicity. Only thing is, I'm not sure how they make money, they have some advertising when you visit the home page, but it's very minimal.
There are many commercial tools that do make this operation effortless. I won't mention any names because this isn't an advertising forum. A quick search should turn up a handful of possibilities; I've used many of the more popular ones and found them satisfactory.
Our support desk typically uses WebEx which works really well.
There are a large number of tools which will do this. Your best is to pick a tool which has a reverse connection from the person who needs help back to the helper. This will make sure that you do not have users try and configure firewalls/open ports etc. Webex is a good recommendation by Old Nick. Another option is GotoAssist, there is also Gotomeeting which can have the same remote control functionality and is cheaper i believe. The main thing is making sure it is as easy as it can be for your users, trying to walk a user through installing an active-x control can be hard enough.
I'd suggest trying LogMeIn. It's nice because once you have the user set up the client software, you can arrange with them a time to leave their PC unattended so that you can remote in and take a look (with the option to disable local keyboard/mouse and monitor access). You can also connect such that the local peripherals are enabled and watch "over their shoulder" as they replicate a problem.
There is of course also Copilot by Fog Creek. Have never used it myself, but it looks pretty easy to use, also for non-technical people.
I use CrossLoop for that kind of thing

Resources