Create a list of the users and groups to ignore
Add all of the accounts that should not be migrated to a text file. For example, create a text file named user.ignore and include all of the user accounts you don’t want to migrate into Active Directory. For default system and service accounts that have known UIDs, you can create the text file programmatically using code similar to the following:
cat *.passwd | \egrep "x?:[0-9]:[0-9].|x?:[0-9][0-9]:[0-9].|x?:60[0-9][0-9][0-9]:[0-9]|x?:65[0-9][0-9][0-9]:[0-9]" | \ cut -d ":" -f 1 | \ sort | \ uniq | \ sed 's/^/\^/' > user.ignore
Other accounts you have identified as invalid can be added manually or using code if they share some common attribute, such as LOCKED in the password field.