cloud.net

Thursday, January 24, 2008

Enumerating sharepoint site templates

You can run stsadm -o enumtemplates
If you've added a template to the Sharepoint Portal Server Template Gallery you'll notice that these template are not listed when using stsadm.
Stsadm will not list stp templates or the default templates either so I'll list them here with Title and Name:

Team Site, STS#0
Blank Site, STS#1
Document Workspace, STS#2
Basic Meeting Workspace, MPS#0
Blank Meeting Workspace, MPS#1
Decision Meeting Workspace, MPS#2
Social Meeting Workspace, MPS#3
Multipage Meeting Workspace, MPS#4
Business Activity Services Team Site, BAS#0
SharePoint Portal Server Site, SPS#0
SharePoint Portal Server Personal Space, SPSPERS#0
SharePoint Portal Server My Site, SPSMSITE#0
Contents area Template, SPSTOC#0
Topic area template, SPSTOPIC#0
News area template, SPSNEWS#0
News Home area template, SPSNHOME#0
Site Directory area template, SPSSITES#0
SharePoint Portal Server BucketWeb Template, SPSBWEB#0
Community area template, SPSCOMMU#0

Friday, January 18, 2008

WinXP SP3 DCOM System Error {DCBCA92E-7DBE-4EDA-8B7B-3AAEA4DD412B}

I slipstreamed SP3 on to my custom WinXP image because I found SP3 to perform admirably well.
Performance is subjective, but... my notebook was using 100% of CPU1 when playing ripped 1080p content and some it wouldn't even play at a reasonable frame rate. I tried everything with the player and drivers, but I didn't resolve the problem until installing SP3. After SP3 CPU1 was at 48%... same video drivers, same player... same XP image but with SP3 slipstreamed over SP2.

After installing SP3 I noticed the below error in the event log and tracing it back through the registry lead me to the NAP Service Agent.
Event Type: ErrorEvent Source: DCOMEvent
Category: None
Event ID: 10016
Date: 28/12/2007
Time: 10:44:58 AM
User: NT AUTHORITY\SYSTEM
Computer: RY4VM
Description:The application-specific permission settings do not grant Local Launch permission for the COM Server application with CLSID {DCBCA92E-7DBE-4EDA-8B7B-3AAEA4DD412B} to the user NT AUTHORITY\SYSTEM SID (S-1-5-18). This security permission can be modified using the Component Services administrative tool.


NAP is some *1/2 baked MS Security service used in Win2008 and Vi$ta networks (see below). So disable the service and then stop the COM component from running:
  1. Win + R services.msc
  2. Disable NAP service
  3. Win + R C:\WINDOWS\system32\Com\comexp.msc
  4. Expand Component Services > Computers > My Comp > DCOM Config
  5. Right Click NAP Agent Service
  6. Select Properties > Location
  7. Uncheck "Run application on this computer"

Network Access Protection. Network Access Protection (NAP) is a new client health policy creation, enforcement, and remediation technology that is included in the Windows Vista Business, Windows Vista Enterprise, and Windows Vista Ultimate operating systems, and in the Windows Server 2008 operating system. With NAP, administrators can establish and automatically enforce health policies which can include software requirements, security update requirements, required computer configurations, and other settings. See below for more information about NAP.
Exposure of client devices to malicious software, such as viruses and worms, continues to increase. These programs can gain entry to an unprotected or incorrectly configured host system, and then use this system as a staging point to propagate to other devices on the corporate network. Network administrators have a new platform to mitigate this threat with Network Access Protection (NAP) from Microsoft, a new set of operating system components included with Windows Server 2008 and Windows Vista that provides a platform to help ensure that client computers on a private network meet administrator-defined requirements for system health.

NAP enforces health requirements by monitoring and assessing the health of client computers when they attempt to connect or communicate on a network. Client computers that are not in compliance with the health policy can be provided with restricted network access until their configuration is updated and brought into compliance with policy. Depending on how NAP is deployed, noncompliant clients can be quarantined or automatically updated so that users can quickly regain full network access without manually updating or reconfiguring their computers.

With NAP, administrators can do the following:

  • Help ensure the ongoing health of desktop computers on the LAN that are configured for DHCP or that connect through 802.1X authenticating devices, or that have NAP IPsec policies applied to their communications.

  • Enforce health requirements for roaming laptops when they reconnect to the company network.

  • Verify the health and policy compliance of unmanaged home computers that connect to the company network through a VPN server running Routing and Remote Access (RRAS) service.

  • Determine the health and restrict access of visiting laptops brought to an organization by partners and other guests.

Designed for flexibility, NAP can interoperate with any vendor’s software that provides a System Health Agent (SHA) and System Health Validators (SHVs). NAP also includes an API set for developers and vendors to build their own components for network policy validation, ongoing compliance, and network isolation. Examples of third-party solutions that work with Network Access Protection would be antivirus, patch management, VPN, and networking equipment.

Debugging SharePoint GAC dll's

Debugging sharepoint dll's is pretty straight forward and just like any other dll.
What you need:
  1. The program database file (pdb)
  2. The source files
  3. A compatible debugger (VS 2005)
  4. Access to the dll registered directory (global assembly cache/ webapp bin)
For this example we're gona debug a GAC dll, so the only task post dll registration is to copy the pdb to the GAC directory.
Note: Copying the pdb may NOT be required with VS 2008 as it will look in the project debug directory for the pdb.

To copy the pdb, if required, to the gac you have various options some are listed below by my order of preference.
  1. Use the subst command to map a drive to the GAC
    • Type: Win + R > cmd > Enter
    • subst X: %windir%\assembly\gac_msil
    You should now have an X: drive pointing to your intermediate language assembly cache. Locate your dll directory and copy the pdb file.
  2. Use the copy command to copy your pdb file
    • Type: Win + R > cmd > Enter
    • copy <your_pdb_location> c:\windows\assembly\gac_msil\<your_dll>\<version>__<public_key>
    I create a post build event to accomplish this.
  3. Edit or rename the Desktop.ini file in c:\windows\assembly\
    • Type: Win + R > cmd > Enter
    • attrib c:\windows\assembly\desktop.ini -h -r -s
      rename c:\windows\assembly\desktop.ini desktop.dir
    You should now be able to browse the GAC directory.
  4. Disable cache viewer in the registry
    • Type: Win + R > regedit > Enter
    • create a new dword key under HKLM\Software\Microsoft\Fusion\ with the nane DisableCacheViewer and set it’s [DWORD] value to 1.
      Or you could also just change HKEY_CLASSES_ROOT\CLSID\{1D2680C9-0E2A-469d-B787-065558BC7D43}\Server\ default to xShfusion.dll or delete the value.
    You should now be able to browse the GAC directory.
Debugging
  1. Create a break point.
  2. Do an IIS reset, cos 90% of the time if you don't you'll crash IIS and VS.
  3. Open a SharePoint page you know uses the dll
  4. Attach the w3wp.exe process with your application user id to the debugger.
  5. Interact with the page until you reach your break point.

Monday, January 7, 2008

Virutal PC (VPC) jerky cursor

The reality of working with sharepoint is that you need to use a virtual pc running win2003/2008. My preference has always been for VMWare, and VMWare 6.0 really wipes the floor with MS Virtual PC. Unfortunately sometimes I am forced to work with VPC, and one of the things that really bugged me was a jerky cursor... searching google didn't help much so I figured it would be something to do with the graphics (after changing a reg setting to increase resolution of the mouse and noticing other jerkiness), and sure enough I eventually found it. Fix: On a VPC with Win2003 go to Display Properties > Settings > Advanced > Troubleshoot slide the hardware acceleration all the way to Full.

Wednesday, January 2, 2008

HTTP / HTTPS Header Check

http://www.webconfs.com/http-header-check.php

Carbon neutral!

I am boycotting any company offering me a BS carbon offset (CO) product. This CO stuff has gone beyond stupid; the other day I saw a rather lengthy commercial for CO car insurance, WTF!
Give me a break... I'm not going to go in to detail on this public medium as I may want to enter an "environmentally conscious" country one day, but there is a concerted effort to push an agenda that is not entirely what it portrays to be.
Don't get me wrong I love the planet more than most and I do everything I can to conserve fuel, electricity, I recycle and I'm against carbon fuels (oil maybe abiotic) for transportation.
CO products have no positive impact on society except to make the consumer feel expunged from polluting. In a world where I have no option but to buy a combustion engine cars, trying to sell me CO car insurance is an insult to my intelligence.

So I'm boycotting CO products BUT I will personally go out of my way to support/endorse products which in some way aid scientific research in to alternative energy sources.

If I ruled I would:

  1. Encourage electric car production using Fuel Cell and current battery tech.
  2. Develop geothermal energy... drill a hole far enough into the ground and it gets hot; hot = energy; ground = everywhere... why is this so hard for people to understand?
  3. 1/2 military expenditure, and spend the surplus on alternative engery research. International treaty to 1/2 military expenditure would be preferable.
  4. 1% tax on all domestic, 2%foreign financial transactions.

There the above will give any government more than enough money to plant enough trees to make all car insurance carbon nuetral.

Monday, December 31, 2007

Online Open Port Check Tool

CanYouSeeMe.org - Open Port Check Tool. This is really useful for both security and usability (P2P). http://www.canyouseeme.org/