Dave's Technophorical Times

A blog about Microsoft's Technologies!
SharePoint :: MVC :: ASP.NET :: IIS :: SQL Server :: Visual Studio :: MS Access

My Hyper-V VM disappeared and this blog save the day!!

https://coolcomputerguy.wordpress.com/2010/08/24/recovering-hyper-v-virtual-machines-that-have-disappeared/ 

JUST IN CASE THE BLOG LINK DOES NOT WORK I HAVE PASTED IT BELOW!

This may sound strange but to anyone who has used Microsoft Hyper-V for server virtualization for any length of time knows, it is something you have either confirmed to be true or you believe you are losing your mind.

In test environments, disappearing virtual machines may have been attributed to not stopping at Starbucks that morning, assumed hallucinations due to lack of sleep from the all night server maintenance from the night before or simply doubt in the busy world of IT that the missing machine had actually been created in the first place or possibly accidentally been deleted somewhere in the fray.

In some cases, when the affected virtual machine is heavily relied upon for day-to-day business and it suddenly just isn’t there, this problem is confirmed and we start hunting for solutions.

For those that are not sure they saw correctly, I am here to confirm for you that Hyper-V Virtual Machines can and do disappear.  They sometimes disappear right before your very wary sleep deprived eyes as you stare unbelievingly at your Hyper-V Management Console, straining to find that virtual machine you spent 2 weeks setting up and not finding it in the list of available machines.

What happened to it?

Well, simply, the XML configuration file for that machine has most likely become corrupt which makes the Hyper-V management service unable to process it causing the machine to not appear in the Hyper-V console.

Now don’t just go and start deleting files and copying things around.  Hyper-V uses an amusingly complicated series of GUIDs cross linked in multiple XML files and similarly named folders in a particular hierarchy to keep all the virtual machines, their hard disks and their snapshots in sync.  One wrong move here and you will lose a snapshot or possibly the entire virtual machine.  This can also be recovered if you have the virtual disk files but that is research for another article.

Back to our corrupt XML file.  The solution to this problem is really very simple.  Find the XML configuration file for the virtual machine that just disappeared, make a backup copy of it and then open it in Internet Explorer.  You should notice if you scroll down through the file that IE cannot render the entire XML file.  This is due to some malformed XML that Hyper-V has randomly inserted into your file as a bonus just to give you more gray hair and raise your blood pressure a bit if it wasnt high enough already.

If you open your XML file in Visual Studio or some other IDE that marks up XML, you can see the malformed XML and with a little bit of examination and care, determine what needs to be fixed.  I have provided an example of one of my corrupt files below.  If you look carefully, you will see that there are two </configuration> tags at the end of the file and just after the first one, it appears that some of the information from just above it was mangled just a bit and then repeated resulting in some bad XML and a second end </configuration> tag.  I removed everything after the first </configuration> tag, saved the file, restarted my Hyper-V Management Service, and my virtual machine reappeared in my Hyper-V management console.

I have seen other examples of this where the XML file contained control characters or symbols which will cause the same problem.  Removing those characters and restoring the proper XML format usually fixes the problem.

So, when it appears that all is lost, it is actually a very simple fix.  Special thanks to Microsoft for giving me a heart attack and hopefully they can tighten this up in a future build.

Good Luck.

Example of the Malformed XML at the end of the configuration file.  The text in Red is the extra repeated xml.

<stopped_at_host_shutdown type=”bool”>False</stopped_at_host_shutdown>
</settings>
</configuration>l”>False</stopped_at_host_shutdown>
</settings>
</configuration>

The end of the XML file should look like this:

<stopped_at_host_shutdown type=”bool”>False</stopped_at_host_shutdown>
</settings>
</configuration>

To Stop and Restart the Hyper-V Virtual Machine Management Service from a command line, run the following two commands:

Net stop “Hyper-V Virtual Machine Management”
Net start “Hyper-V Virtual Machine Management”



From here: https://social.technet.microsoft.com/Forums/exchange/en-US/46e1cd52-52b3-4427-88a3-200f87319e23/remote-desktop-authentication-error-has-occurred-the-function-requested-is-not-supported?forum=w7itpronetworking 

Here is the FIX for this issue ..

Change the Group Policy on your local client to use the vulnerable setting 

Run:  gpedit.msc

Go to à Computer Configuration -> Administrative Templates -> System -> Credentials Delegation -> Encryption Oracle Remediation

Open - Encryption Oracle Remediation à  choose Enable  à change protection level àVulnerable à Apply



Some people recommend using ….control + alt + end on a RDP session to bring up that Windows Security screen, but it does NOT work on nested RDP sessions.

This procedure is the only one which worked for me on a Windows 2012 R2 RDP session:

  1. Click Start
  2. Type osk (to bring up the on screen keyboard)
  3. Hit enter
  4. Once the on screen keyboard is open, hold ctrl+Alt on your physical keyboard, then click on the del key in the on screen keyboard.
  5. Minimize the on screen Keyboard
  6. Click Change a password.

  



If your view is set to "datasheet view", then it is only for people with contribute rights or above for the list. If you want a user with read-only rights (Vistors) to be able to view the list, then you have to create a view using "Standard View," and set that to the default view.



QUESTION:

We are using the Bamboo Data-View Web Part in SharePoint 2013 to allow users to filter and export results from a single Library and I have just discovered that the Filter is hidden in a column when you have a Multiple Lines of Text in the grid. This makes the tool pretty useless now so I was hoping that someone has come across a better Web Part?

ANSWER:

So the answer is that Multi-line Text fields in SharePoint are NOT searchable or Filterable, end of story. I have found a solution that works. This solution is to keep a SQL Server table update to date with the library data, less the documents of course, and use a nvarchar(4000) column for the multi-line text fields. We will never exceed that number of characters so this works great plus it's much faster than rendering a SharePoint Library!



If this happens then check the Application Event Log. If you see the message below then you need to change your registr settings

MAPISendMail: Failed to submit message. Attachments to the message exceeded the size limit set by your Administrator.

Computer\HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\Preferences

If there is a Key called MaxiumAttachmentSize then delete it or enter a value of 1000+. Setting it to zero appears to cause this error. 

Helpfull link: https://support.microsoft.com/en-ca/help/2813269/attachment-size-exceeds-the-allowable-limit-error-when-you-add-a-large 



https://stackoverflow.com/questions/15492004/delete-top-2-in-access

DELETE FROM (SELECT TOP 2 * FROM Table1) 

 



https://stackoverflow.com/questions/7892334/get-size-of-all-tables-in-database 

Is there an easy way to determine how much space on disk each table is consuming?

SELECT 
    t.NAME AS TableName,
    s.Name AS SchemaName,
    p.rows AS RowCounts,
    SUM(a.total_pages) * 8 AS TotalSpaceKB, 
    CAST(ROUND(((SUM(a.total_pages) * 8) / 1024.00), 2) AS NUMERIC(36, 2)) AS TotalSpaceMB,
    SUM(a.used_pages) * 8 AS UsedSpaceKB, 
    CAST(ROUND(((SUM(a.used_pages) * 8) / 1024.00), 2) AS NUMERIC(36, 2)) AS UsedSpaceMB, 
    (SUM(a.total_pages) - SUM(a.used_pages)) * 8 AS UnusedSpaceKB,
    CAST(ROUND(((SUM(a.total_pages) - SUM(a.used_pages)) * 8) / 1024.00, 2) AS NUMERIC(36, 2)) AS UnusedSpaceMB
FROM 
    sys.tables t
INNER JOIN      
    sys.indexes i ON t.OBJECT_ID = i.object_id
INNER JOIN 
    sys.partitions p ON i.object_id = p.OBJECT_ID AND i.index_id = p.index_id
INNER JOIN 
    sys.allocation_units a ON p.partition_id = a.container_id
LEFT OUTER JOIN 
    sys.schemas s ON t.schema_id = s.schema_id
WHERE 
    t.NAME NOT LIKE 'dt%' 
    AND t.is_ms_shipped = 0
    AND i.OBJECT_ID > 255 
GROUP BY 
    t.Name, s.Name, p.Rows
ORDER BY 
    t.Name



You created a DLL in Visual Studio 2010 so you can reference it in MS Access VBA.

It works fine in 32-bit Office but you get an error (error 429 activex component can't create object) when trying to run in 64-bit Office.

Solution: Unfortunatley non built-in ActiveX objects cannot be created in 64-bit Office and there is no direct work around for this.



I ran into a very strange error recently when I took over someone elses MS Access project. The so called developer did not use Option Explicit anywhere in the code so I added it into all modules and fixed all the misspelled variables and missing variables. Then the final Error I got when compiling was "Procedure Too Long"! That was odd as the routine in question was maybe 1000 lines long so it was NOT too long at all. After reviewing the code in more detail I decided to change some of the massive If-Then-Else blocks into Case Statements and just like magic, after the first one, I was able to get past this stupid error.

There must be some sort of limitation on the number of If-Else statements in VBA routines.



The Blogger

Dave Stuart I'm a Developer with a passion for coding. I enjoy the challengers that come with the job! SharePoint is one of my expert areas along with .NET Web Development with MVC and good old MS Access VBA coding. I Blog so that I can remember how I did that way back when; PLUS all this stuff is searchable! I constantly study and run my own business, Dafran Inc. I have passed 22 Microsoft Exams since 1998 when I first jumped on the treadmill of knowledge. I hope that you enjoy this Blog as much as I enjoy updating it. All the very best from Calgary, Alberta, Canada. contact me at linkedin @ dafran.ca

Calendar

<<  December 2018  >>
MoTuWeThFrSaSu
262728293012
3456789
10111213141516
17181920212223
24252627282930
31123456

View posts in large calendar

Sign in