PowerShell
Edit|Remove
#Helps to maintain a "clear" AD group for Project Server AD Import. 
#Given a filled source group and an existing destination group it will clear the membership of the destination group and then 
#fill it with a list of all ACTIVE user account members of the source group (no inactive, no contacts) 
#Afterwards the destination group could be used with a Project Server Active Directory sync 
#should run before each AD sync job. 
 
 
Param( 
   [string]$sourcegroup, 
   [string]$destinationgroup 
 ) #end param 
 
function Build-MPS-compatible-ADGroup 
{ 
 Param( 
   [string]$sourcegroup, 
   [string]$destinationgroup 
 ) #end param 
 
get-adgroup $destinationgroup |set-adobject -clear member 
 
Get-ADGroupMember -Identity $sourcegroup -Recursive | Get-ADUser | Where-Object {$_.Enabled -eq $True} | ForEach-Object {Add- 
 
ADGroupMember -Identity $destinationgroup -Members $_} 
} 
 
#execute Function 
Build-MPS-compatible-ADGroup -sourcegroup sourcegroupname -destinationgroup destinationgroupname 
 

Microsoft Project Server 2010 and especially 2013 are extremly sensible when Active Directory sync is used for security groups or the Enteprise Resource Pool. This script will maintain a copy ("destination") of an existing Active Directory ("source") group and take care that this group will only contain of active user accounts (no contacts, no inactive users).

The script needs the ActiveDirectory PowerShell module.