EzDevInfo.com

windows-update interview questions

Top windows-update frequently asked interview questions

How to keep a tree of VM snapshots up to date with Windows Update?

For testing our product's installer, I maintain a tree of virtual machine snapshots with different previous versions installed. It is a tedious task to do Windows Update, re-snapshot, delete parent snapshot on each VM.

Is there an automated solution for keeping a group of VMs up-to-date? I use VirtualBox but have access to VMware Workstation and would switch if maintenance would improve.


Source: (StackOverflow)

Windows update caused MVC3 and MVC4 stop working

am i the only one who installed a Windows Update (8.1) on october 15, and suddenly MVC stop working because of this warning?

Warning 1 Could not resolve this reference. Could not locate the assembly "System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

It seems that this windows update installs a newer version of MVC with version number 4.0.0.1, and removes old version from program files folder.

Someone know how to fix this without crawling for each project?


Source: (StackOverflow)

Advertisements

Excel/VBA Automation Errors due to Office Service Pack 3.0 caused by Forms

After installing all latest windows updates my Excel VBA code is showing an automation error at the very start of the first module. It contains some forms as well as numerous modules of VBA code. However, when removing the forms (and associated code) everything is fine.

The same thing happened about a year ago after some other windows updates. Back then deleting the .exd files did the trick, but the current updates (including Service Pack 3) seem to be different.

What is going on and how can I get the forms to work? All the code is unchanged and has survived all previous windows/office updates. Running Windows 7 (same happening on Vista machine) and Office 2007.


Source: (StackOverflow)

Automatically update Windows fully

I'm working on a project where the goal is to be able to update a windows computer 100%. That means a program or a script that updates windows automatically with no user interaction at all. Ideally a standalone script that can be run from another script.

The reason: I need to update a lot of computers in my line of work. They can be at any patch level and everything from Windows XP to Windows 8. My goal is to start a script, wait/do something else and then find a fully patched computer.

I've solved a lot by finding ZTIWindowsUpdate.wsf in the MDT Task Sequence.

This can be used like this from an admin cmd:

cssript.exe ZTIWindowsUpdate.wsf

My problem so far is that the computer requires a reboot between some of the updates. Probably because of dependencies. ZTIWindowsUpdate.wsf needs to be run as administrator and i can't seem to find a solution to start it as administrator at reboot. Additionally if I get the script to run on startup, how do I stop it, and how do I know when its time to stop it?

Can someone help med with a foolproof solution to this problem?

Thanks!


Source: (StackOverflow)

Is it possible to use Windows Update to update a program?

As we know we can set an address so Windows downloads its updates from specific address.

I want to make update files and put them on that specific address on a server and computers on network download updates from that address and install updates.

The question is that:

  1. Is it possible to manipulate other programs files and settings (except Microsoft applications) using Windows Update?
  2. If yes, how to make a Windows Update package ?

Source: (StackOverflow)

How to handle changeover from ASP MVC version 4.0.0.0 to 4.0.0.1

This is a followup to Windows update caused MVC3 and MVC4 stop working

I also had the issue where windows update on my development machine caused my MVC 4 project to stop working. I changed the assembly reference to target version 4.0.0.1 and it started working. For me.

My problem is that the application is then deployed on a number of web servers. Actually we have a build server where the customer versions are built and then a number of web servers.

First question: When we run windows update on the production servers are the old versions of the app going to stop working? I am guessing that the answer is "yes". We have not yet run windows update on either the build or production machines.

Changing the reference meant that it no longer could be built on the build machine. I can get around this by setting the Specific Version flag to false and Copy Local to true. Then it builds on both my development environment and on the build server.

Question: How lax is the check if I have Specific Version false? Does it allow 4.0.0.x? 4.0.x.x? 4.x.x.x? or x.x.x.x?

However, it even thoguh it builds in thsi configuration it then fails to run (cannot find assembly) on the test web server. The problem here is that I have the following in my web.config (as per Microsofts instructions when I upgraded from MVC 2 to MVC 4):

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
    <assemblyIdentity culture="neutral" name="System.Web.Mvc" publicKeyToken="31BF3856AD364E35"/>
    <bindingRedirect newVersion="4.0.0.1" oldVersion="0.0.0.0-4.0.0.1"/>
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35"/>
    <bindingRedirect newVersion="2.0.0.0" oldVersion="1.0.0.0"/>
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
    <bindingRedirect newVersion="4.0.0.0" oldVersion="1.0.0.0-3.0.0.0"/>
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35"/>
    <bindingRedirect newVersion="2.0.0.0" oldVersion="1.0.0.0"/>
  </dependentAssembly>
</assemblyBinding>

The problem is the line

<bindingRedirect newVersion="4.0.0.1" oldVersion="0.0.0.0-4.0.0.1"/>

for the System.Web.Mvc assembly. (It used to say 4.0.0.0 not 4.0.0.1 in that row of course.) If I change back to 4.0.0.0 on the test server then it works.

My problem is two-fold. Partly it is just that I want to be able to build and run both locally and on our build/production servers. However, we have a situation where we host a number of customers running different versions of our application on the same server. We cannot force all our customers to upgrade to latest version at once just because of this windows update fix - apart from anything else the web application is just part of a larger suite of applications so we would have to force them to upgrade the lot!

I suppose one option is to checkout each of the old version still in use, update the MVC version number and create a new version. Then when we update the web server we have to update all the customers on that server to a new (4.0.0.1 compatible) version of their current version. I'd really like to avoid having to update, commit and rebuild that many versions if possible.

Another option would be to not run the windows update on the web server and try and install both 4.0.0.0 and 4.0.0.1 dlls on the build machine. Then we could build both old and new version. Since any new versions (using 4.0.0.1) have CopyLocal set to true on the MVC assembly (the old ones do not) they should be able to be deployed to the web servers without the web servers themselves being updated.

Questions:

  • Does anyone know if it is possible to have both versions installed simultaneously? I am hoping I could simply save the 4.0.0.0 dll, run windows update then copy to old dll back to GAC alongside the new.
  • How serious is the security risk fixed by this patch? Is it a problem to allow people to run the old versions a while longer? Is just having the old .dll on the web server a security risk or only for the applications which use it?
  • Is there any way of doing a bindingRedirect to 4.0.0.x? or is it possible to simply remove the binding redirect altogether?

I cannot believe I am the only one in this situation and would also welcome any suggestions for solutions I haven't thought of at all.


Source: (StackOverflow)

Using WUA remotely using C#

I am trying to connect to a remote machine and determine if there are any Windows Updates to be installed using C# and WUApiLib. It seems pretty straightforward, however I cannot find out how to actually connect to the remote computer.

http://msdn.microsoft.com/en-us/library/aa387288(v=VS.85).aspx identifies that is can be used remotely, with a few exception that I am not concerned about, but there seems to be no documentation on how to actually connect. I tried passing in a computer name, but this did not work as well (passing a name containing gibberish "succeeds" the same as passing nothing, and results in the same counts so I assume that string is unused.)

var updateSession = new UpdateSession(dependencies.ComputerName);
var searcher = updateSession.CreateUpdateSearcher();
var results = searcher.Search("IsInstalled=0 and Type='Software'");

Does anyone know who do use WUA remotely via C#?


Source: (StackOverflow)

DateTime.ToLocalTime() stopped working on XP in August 2013

We have a VB.NET application installed on a customer's PC running XP, on which it appears that DateTime.ToLocalTime() has stopped working.

The problem first manifested itself in August 2013.

The customer is based in Texas, and their timezone is correct.

The documentation for DateTime.ToLocalTime() has the following interesting note:

On Windows XP systems, the ToLocalTime method recognizes only the current adjustment rule when converting from UTC to local time. As a result, conversions for periods before the current adjustment rule came into effect may not accurately reflect the difference between UTC and local time.

Therfore it appears likely that a timezone rule change was introduced in the August Windows Update, which has caused this.

I've found the following: http://support.microsoft.com/kb/2863058 which indicates that a cumulative timezone update was applied in August 2013, but no USA rules seem to be implicated in this change.

Has anyone else had experience of this problem, and (of course) a solution?

Edit

To clarify a bit. The times in question are stored in UTC in a SQL database, and we're converting to LocalTime for display. It's the display which is causing the problem.

Events which were recorded at 1500 localtime are now showing as recorded at 2100.


Source: (StackOverflow)

How to reliably check whether Windows Update is enabled using C#?

I tried to check if Windows Update is enabled. I added a reference to c:\windows\system32\wuapi.dll on Windows 7 x64 Ultimate and wrote this code

using WUApiLib;
public Boolean IsWindowsUpdateEnabled()
{
    var updates = new AutomaticUpdatesClass();
    return updates.ServiceEnabled;
}

The code fails to build. I get the following error:

Error 1 The type 'WUApiLib.AutomaticUpdatesClass' has no constructors defined
Error 2 Interop type 'WUApiLib.AutomaticUpdatesClass' cannot be embedded. Use the applicable interface instead.
Error 3 'WUApiLib.AutomaticUpdatesClass' does not contain a definition for 'ServiceEnabled' and no extension method 'ServiceEnabled' accepting a first argument of type 'WUApiLib.AutomaticUpdatesClass' could be found (are you missing a using directive or an assembly reference?)


Source: (StackOverflow)

Opening WebMatrix solutions in VS failing when 2 versions of VS installed

Microsoft's WebMatrix development tool has a "Visual Studio" button to launch the VS editor and load it with the site you have open in WebMatrix.

Normally it loads VS 2010, since that's the only version that supports WebMatrix sites. But the other day at home it started trying to load VS 2008, and I got the error message:

The selected file is a solution file, but was created by a newer version of this application and cannot be opened.

This also started happening at work today. At both work and home I have VS 2010 and VS 2008 installed side-by-side. Does anybody know what the problem is and how to fix it?

At home I tried uninstalling VS 2008 and restarting the machine, but WebMatrix still couldn't see VS 2010 and prompted me to download some other free tool.

Microsoft recently sent out a bunch of updates, and as always, I applied the important ones. I wonder if that caused it.


Source: (StackOverflow)

How to you determine when Windows is done rebooting?

I am using the Windows Update API to update a bunch of VM's. With Windows Update comes the inevitable reboots. Can anyone think of a way that I could tell from a remote server if the windows box has indeed finished its reboot? All ideas or thoughts would appreciated.

EDIT: Because the VM's are in Lab Manager and using a fenced configuration, WMI will not work, and although I thought about using the VM to send a signal when it was back up. There would have been no way to reliably know who to notify as the app waiting for the machine could be on any number of machines so it just didn't seem reasonable. However time is not essential (and even though I know this will bite me sometime when a Service Pack comes down) I have had good success with the PING and then wait 5 minutes so far, so I am going to use that for now. If I run into exceptions I will then try to implement the VM notfiying the world when it comes back up. Thanks to all.


Source: (StackOverflow)

Suddenly getting "Unable to make the session state request to the session state server"

The setup: 2 web servers and a seperate state server

I have two production web servers in a load balanced configuration. The ASP.NET web app they host shares state (like a web farm) using this line in their web.configs:

<sessionState mode="StateServer" stateConnectionString="tcpip=9.9.9.9:42424" cookieless="false" timeout="60"/>

9.9.9.9 is the IP of the machine the asp.net session state service is running on (ok it's not 9.9.9.9 really, changed to protect the innocent). It's a third machine (the database server, actually.

It worked fine until...

The error: website down!

Suddenly the site went down, just showing a generic asp.net error page ('turn custom errors off to see this error' or whatever).

The app's log recorded the actual error message:

An unhandled exception occurred Unable to make the session state request to the session state server. Please ensure that the ASP.NET State service is started and that the client and server ports are the same. If the server is on a remote machine, please ensure that it accepts remote requests by checking the value of HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters\AllowRemoteConnection. If the server is on the local machine, and if the before mentioned registry value does not exist or is set to 0, then the state server connection string must use either 'localhost' or '127.0.0.1' as the server name.

So it appears that the web app was unable to contact the state server (9.9.9.9).

I "tried turning if auf and then onnegen" - restarting the state server fixed the problem.

Why?

I really want know what happened and why so I can prevent it happening again.

So far all I have are two theories:

  1. A windows update, to .net framework 4, was applied around that time on the state server. So maybe the update did something to the asp.net state service? The windows event viewer showed that .net 4 had logged a warning around then:

    Updates to the IIS metabase were aborted because IIS is either not installed or is disabled on this machine. To configure ASP.NET to run in IIS, please install or enable IIS and re-register ASP.NET using aspnet_regiis.exe /i.

  2. Some kind of temporary network problem between the prod web sites and the state server? They do sit right next to each other in the same physical rack though.

  3. ??? Any other ideas, anyone?

Anyone seen this before, or able to correct me on anything?


Source: (StackOverflow)

WUApiLib IUpdateInstaller2 yields Error; Some OS updates install others throw HResult -2145124318

Updates are being downloaded from a local server and not from WUS or Microsoft Repositories. Local server is Linux based which host's the contents for each update.

I'm not using UpdateDownloader to download from Microsoft Servers, i manually download the update content and then use CopyToCache.

These installed fine

Security Update for Microsoft .NET Framework 3.5 SP1 on Windows XP, Server 2003, Vista, Server 2008 x86 (KB2736416)

Security Update for Microsoft Visual Studio 2010 (KB2542054)

These Didn't

Security Update for Microsoft .NET Framework 4 on XP, Server 2003, Vista, Windows 7, Server 2008 x86 (KB2840628)

Update for Microsoft .NET Framework 3.5 SP1 on Windows XP, Server 2003, Vista and Server 2008 x86 (KB2836940)

How my process works

I receive this for an install from a local server which i use to download all download content for the update. (The blockquote text above KB2840628 is the example provided below)

{
  "app_uris": [
    {
      "file_name": "msipatchregfix-x86_94a84b80b8b45a1ac53a0e5d085513da0f099655.exe",
      "file_uri": "https://192.168.5.108/packages/d13c13c81f94fbb48f39c817a71ff239a31773d3a0e821a968dc42a913892841/msipatchregfix-x86_94a84b80b8b45a1ac53a0e5d085513da0f099655.exe",
      "file_size": 130600
    },
    {
      "file_name": "ndp40-kb2840628-v2-x86_891d50ff3c1322db3fb0fde222ebb0aaa5260272.exe",
      "file_uri": "https://192.168.5.108/packages/d13c13c81f94fbb48f39c817a71ff239a31773d3a0e821a968dc42a913892841/ndp40-kb2840628-v2-x86_891d50ff3c1322db3fb0fde222ebb0aaa5260272.exe",
      "file_size": 13294216
    }
  ],
  "app_id": "d13c13c81f94fbb48f39c817a71ff239a31773d3a0e821a968dc42a913892841",
  "app_name": "Security Update for Microsoft .NET Framework 4 on XP, Server 2003, Vista, Windows 7, Server 2008 x86 (KB2840628)"
}

With that said, the problem is that some updates install perfectly fine, but certain updates (I believe the ones that have more than one bundle-updates) don't go thru, its driving me mad!

I first download each Uri and then load them into the update with CopyToCache.

  var collection = new UpdateCollection();
  IList<string> updateFiles = Directory.GetFiles(updateFolder);
  var fileCollection = new StringCollection();

  try
  {
       foreach (var file in updateFiles)
               fileCollection.Add(file);

       //Error happens here on certain updates. Not all.
       ((IUpdate2)update.BundledUpdates[0]).CopyToCache(fileCollection);
       collection.Add(update);
       return collection;
  }
  catch (Exception e)
  {
     return null;
  }

After this, the returned collection is passed through my WindowsUpdateInstaller Method shown below:

IUpdateSession Session = new UpdateSession();
var updatesToInstall = //THIS GETS THE RETURN FROM THE ABOVE CODE...
var installer        = (IUpdateInstaller2)Session.CreateUpdateInstaller();

installer.ForceQuiet         = true;
installer.AllowSourcePrompts = false;
installer.Updates            = updatesToInstall;

foreach (IUpdate updateNode in installer.Updates)
{
   updateNode.AcceptEula();
}

//FAILS HERE WITH "-2145124318, Result code: orcFailed",
var installationRes = installer.Install(); 
var installResult   = installationRes.GetUpdateResult(0);

The update installs just fine if i manually double click on the executable it and install it manually without using the code.


Source: (StackOverflow)

Check when last check for Windows Updates was performed

How can I check WHEN last check for windows updates was performed - in code (c#/.Net)?

Not WHICH updates are or are not installed, but WHEN last check was performed?

Best of all would be a complete history of when checks for windows updates had been performed, but I can certainly live with only knowing the last check.


Source: (StackOverflow)

Download Windows Updates Using C#

Is there any way to Download updates of windows programmatic using c#. (Then we can manage it)


Source: (StackOverflow)