By default, MOSS uses the (&(objectCategory=person)(objectClass=user)) LDAP search filter when importing your user accounts from Active Directory. This filter imports all enabled and disabled user accounts to MOSS.
To restrict profiles to only “Active” or “Enabled” accounts, here is the filter string:
(&(objectCategory=person)(objectClass=user)( !(userAccountControl:1.2.840.113556.1.4.803:=2)))
To get this into SharePoint, do the following steps
o Go into Central Administration
o Click on SharedServices1 on the left hand side of the page
o Under User Profiles and My Sites, click the first link: User Profiles and Properties
o Near the bottom of the page, click View Import Connections
o Mouse over the only connection you have and click the down arrow and then click Edit
o Scroll down to the Search Settings section. There is a box titled User Filter in that section. Paste in the filter string from above.
o Click OK at the bottom of the page
o In your navigation breadcrumbs near the top of the page, click on User Profile and Properties
o Near the bottom are several bulleted links. Click the 5th one, Start Full Import
This process will go through your existing profiles and mark any previous disabled accounts as inactive profiles and they will no longer be show or accessible in SharePoint. Disabled accounts not previously imported by MOSS will be ignored and no profile will be created.