I ran into a situation where I could not get a gateway server to approve via the Microsoft.EnterpriseManagement.GatewayApprovalTool.exe. It was erroring out saying that "The gateway name already exists as a computer instance.".

After digging into the console (in the computers view), I found that the Nworks management pack had created a "not monitored" computer object for this server because it was a guest operating system running in VMWare and the Nworks management pack had detected the guest system.

I ran across this article which headed me down the path to fixing the situation: (which talks about the gateway approval issue and the MT_Computer table)

http://www.myitforum.com/forums/m_173485/tm.htm 

Further research led to this article which discussed the tables in OpsMgr and how to identify the specific computer record:

http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.opsmgr.setup&tid=43504147-51ed-4592-85d0-fbeb6781e0fb&cat=BACB1FBE-6D3F-CF41-EDA6-F5492A1CD412&lang=en&cr=US&sloc=&p=1

This in turn pointed me to the following link which discussed how to update the IsDeleted record:

http://ops-mgr.spaces.live.com/blog/cns!3D3B8489FCAA9B51!163.entry  

With all of this being said, don’t try this unless you have no other options. It can be a really really bad idea to go messing around in the OpsMgr tables and can make your environment unsupported. As this had to be activated I took the following process to get this gateway server approved:

1) Stopped the nworks collector service from within the nworks VIC configuration utility so it would not re-create the non monitored computer object.

2) Identified the record to change with this SQL query: (from the newsgroups)

/* Selecting Discovered Computers that are not monitored */
/* assumes DNSname=NULL means that the entity is unmanaged. */
select mtc.PrincipalName, mtc.NetbiosComputerName,DNSName,
mtc.basemanagedentityid as bid
from OperationsManager.dbo.MT_Computer mtc,
OperationsManager.dbo.basemanagedentity bme
where mtc.basemanagedentityid = bme.basemanagedentityid and
mtc.DNSName is NULL and
bme.IsDeleted = 0

3) Found the BID number and used it in the following query to clear out this record using this SQL query: (from the ops-mgr blog)

UPDATE dbo.[BasemanagedEntity]

SET IsDeleted = 1

where BaseManagedEntityID='<value for the gateway server in the BID identified above>’

4) Re-ran the Gateway approval tool and it ran successfully/no error about the gateway already existing as a computer instance.

5) After the gateway installation process was completed, re-started the nworks collector services which had been stopped in step #1.

My new OpsMgr gateway server is working like a champ!