Windows Computer Profiler - windows

We create a lot of internal tools in order to work with the data we use. Occasionally we'll run into a problem with one of those tools on a designer or artists computer and will need to spend considerable time on there computer to try and diagnose where the problem may be coming from.
This creates problems because while a programmer is trying to diagnose an issue on the user's computer the user is unable to continue with their work. What we'd like to be able to do instead is run an app that will generate a report that a programmer can look at on their own machine in order to at least rule out some of the more common and obvious problems.
Example information we'd need would be all the environment variables, registry info and installed applications. Is there a decent existing tool that will accomplish this or would it be better to just roll our own?

Start > All Programs > Accessories > System Tools > System Information
or
Start > Run "msinfo32"
Then,
File > Export
and you can take the file back to your desk.

Using Windows Powershell setting up a script that can provide the needed information should be relatively easy. The script center is a great starting place to learn Powershell. If you like to listen to podcasts I would recommend The Powerscripting podcast.

This probably should be on ServerFault.com, since it deals with an end user's configuration and is not necessarily a programming issue.
That said, I would think that you should be able to write a WMI script to cover this.
You'd want to start here
http://msdn.microsoft.com/en-us/library/aa394585(VS.85).aspx

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.

Watching Other Applications With Ruby

I was wondering if it was even possible with RUBY to watch other applications and if a certain application is below a memory threshold it kills it and starts it again.
Operating System would be Windows 7+
Things I need to be able to do:
Monitor Memory
Determine between different processes
Kill Processes
Start new process (bat script or powershell)
Start monitoring again
The watched application running would run high memory when it is working and that is good. If it goes below 1gb I want this application to kill it. Of course when it restarts it would give a grace period for it to load the RAM.
I was going to use the Shoes gui framework to make something nice to wrap around it. It would be theoretically nice to have some sort of auto detection if the application is running.
If this is possible, but requires Gem you think may help I would like to hear about them.
I found Usagewatch Gem seems to be headed the right way, but from a glance at the documentation it is general and I need to be specific about which process I am watching.
If this question is not appropriate here please let me know via a comment and I will remove it and/or move it to a proper place for this type of question to be asked.
I appreciate your time and effort into helping me with this endeavor.
Thank You
I would suggest using the win32 gem. Than start by looking through the Win32 Api documentation. This will give you the most flexible solution and will give you the whole system programming power for Windows. My advice is to make some wrapper functions about the things connected with Windows you need and use them that way, so if you find a more appriete solution you can switch to it easily.

Which is a best practice to start programs automatically in windows, Common startup group or Registry?

I am writing desktop programs for windows and when I need to put some program to start automatically I always use one of those options:
1 - Put a shortcut to the program in the startup group
2 - Create a value key on Windows Registry ("SOFTWARE\Microsoft\Windows\CurrentVersion\Run")
Which of this options is a best practice?
It depends on how much weight you would apply to the following questions:
As a user, should I be able to deactivate the automatic startup easily, even temporarily?
As a user, should I get the feeling that the developer trusts me to know what I'm doing?
Clarification:
If I have a shortcut in the AutoStart folder, I know that I can quickly disable this part by myself and the developer trusts me to do this.
If I don't have this visual clue, I have to actively look for it using more-or-less arcane tools (speaking from experience here).
If the automatic startup is essential for the correct function of the program, by all means, put it somewhere I can't get to it. But if it's a nice-to-have thing, like a "quickstarter", then please don't.

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 do whatever it was that the Windows Installer CleanUp Utility did?

Microsoft's "Windows Installer CleanUp Utility" could be used to help fix broken installations of MSI-installer based products. When the installer failed in some strange way and left corrupt data behind, so bad that even Add/Remove Programs couldn't help, you could often fix things by running this utility and then running the application's installer again.
I just discovered that Microsoft announced a couple weeks ago that they were discontinuing this utility. They didn't merely say "we're not supporting it anymore"; they seemingly removed it from their site entirely.
I have to support a Windows program for a whole bunch of users. Given the number of users, every so often something will go wrong, and this program has been invaluable for me, as a last-ditch line of defense.
I know I could point customers to some third party site that has a cached copy of it, but this seems dangerous (malware potential and such).
So, are there any replacement products? Or, if not, how can I myself do whatever it is that this program did?
To be clear, I'm not asking for help like "how do I programatically modify the registry". I can do that fine. But I need to know what in the registry needs to be modified.
Thanks in advance.
Windows Installer CleanUp utility was never intended to be used in the wild. It was only meant to be used by software developers. If you occasionally have end users needing to use WCU you have some serious installer quality issues that should be addressed.
WCU only removes the Windows Instaleller meta data and doesn't actually uninstall any software. This leaves the machine in a very dirty state. These days with test labs becoming virtualized there's no reason to have this tool anymore. You just roll back to a prior snapshot and keep on working.
I've seen all kinds of online forums full of users who think they know what they are doing ( and don't ) suggest using WCU to solve various problems so in the end Microsoft decided to try to get the horse back in the barn.
I have old copies of WCU archived in my CM system so if you'd like me to generate checksums to help you determine if you are getting a good copy just let me know.
The cleanup utility was a wrapper around the command line utility msizap.exe, described here:
http://msdn.microsoft.com/en-us/library/aa370523%28VS.85%29.aspx#1

Resources