Drop all extended properties in a MSSQL database

February 25, 2010 | 1:42 pm

Sometimes you change columns in a table, and Access starts moaning about the missing column.. Probably Access added some extended properties to tables and/or column, and here’s how to drop them. Keep in mind these all start with MS_..

This script will create a drop statement for all the tables and column. Read the result through carefully, and proceed at your own risk:

--tables
select 'EXEC sp_dropextendedproperty
@name = '''+name+'''
,@level0type = ''schema''
,@level0name = ' + object_schema_name(extended_properties.major_id) + '
,@level1type = ''table''
,@level1name = ' + object_name(extended_properties.major_id)
from sys.extended_properties
where extended_properties.class_desc = 'OBJECT_OR_COLUMN'
and extended_properties.minor_id = 0
union
--columns
select 'EXEC sp_dropextendedproperty
@name = '''+sys.extended_properties.name+'''
,@level0type = ''schema''
,@level0name = ' + object_schema_name(extended_properties.major_id) + '
,@level1type = ''table''
,@level1name = ' + object_name(extended_properties.major_id) + '
,@level2type = ''column''
,@level2name = ' + columns.name
from sys.extended_properties
join sys.columns
on columns.object_id = extended_properties.major_id
and columns.column_id = extended_properties.minor_id
where extended_properties.class_desc = 'OBJECT_OR_COLUMN'
and extended_properties.minor_id > 0

Protect OWA using a reverse proxy

November 24, 2008 | 11:50 pm

Sometimes you just have a single public IP address (unfortunately ipv6 is not that widespread yet), and you still want to publish stuff like Outlook Web Access and other applications to the net in a secure way. If you want that, the easiest way to do so, is to just pass port 443 to the Exchange server. But this means that if you have other web apps, you have to run them on the Exchange server as well. And besides, not everybody wants to put an IIS machine directly out on the net..

One way to solve that, is by putting a reverse proxy like Apache or Squid in front of it. Read more ..

Adding drivers to WDS boot images

February 18, 2008 | 10:56 pm

I wanted to install Windows Server 2008 on some of our servers (Dell PowerEdge 2850’s and 2950’s), but I soon ran into some problems. The DRAC4 in the 2850’s is enormously s-l-o-w, and on the 2950’s, the Windows Server 2008 setup does not recognize the virtual DVD drive that comes with the DRAC5. Joy. I only want to do installations over the network or DRAC’s, because the servers I’m testing on are in our datacenter, 150km away. And I just want to play around for a hobby, not being in a car half the evening to sit in a loud server room flipping cd’s :)

Finally, I installed Windows Server 2008 inside a ESX Server virtual machine (works like a breeze, very fast installation), and I installed WDS (Windows Deployment Services), to enable network installations of Windows Server 2008. It really looks nice, and hell of a lot easier than when I last played with RIS, about 4-5 years ago!

I installed the 2850 quite fast over the network (boot from PXE enabled network card, press F12, and off you go), but the 2950 gave me some headaches. It would boot of PXE, but then the installer whould stop, showing only an error: WdsClient: An error occurred while starting networking: a matching network card driver was not found in this image. Please have your Administrator add the network driver for this machine to the Windows PE image on the Windows Deployment Services server.

After googling, I found out I could do shift+F10 to get a console window, and the ipconfig command showed me that the setup was only recognizing the add-in Intel NIC’s, not the onboard Broadcom NIC’s (which are the only ones connected right now).

So I googled and tried for a few hours, and finally, I got to integrate the Broadcom drivers into the boot.wim boot image. (User ‘ozymandeus’ gave the answer in this topic.)

I download the RIS drivers for the Broadcom Netxtreme II from their site. Watch it, the RIS drivers are under a seperate header on the download page. In the following example, I extracted the two files to c:\bc.

On the WDS server, I downloaded and installed the Windows AIK (1GB download, mount with daemon-tools). In the WDS console, I exported the boot image (I only have a x64 boot image) to c:\boot.wim.

I mounted the image to an empty directory, c:\ff.

> imagex /mountrw c:\boot.wim 1 c:\ff

Add the drivers to the image:

> peimg /inf=c:\bc\b06nd.inf c:\ff

Unmount and commit the changes:

> imagex /unmount /commit c:\

Then, I did the same for image 2 in the boot.wim file:

I mounted the image to an empty directory, c:\ff.

> imagex /mountrw c:\boot.wim 2 c:\ff

Add the drivers to the image:

> peimg /inf=c:\bc\b06nd.inf c:\ff

Unmount and commit the changes:

> imagex /unmount /commit c:\

Then, I replaced the boot.wim file in the WDS console, I booted my 2950, and tadaaaa! Installing!