hello forum members,
i am trying to write code that goes through all resources and updates some custom fields. However, something must have been set up wrong because I am getting a lot of users who are no longer exist in the AD group that is synced to the security group in Project Server and my code keeps erroring out.
can anyone recommend any code on how to eliminate users who no longer exist in AD?
if (checkedOut){
SvcResource.ResourceDataSet updateDs = resourceSvc.ReadResource(resourceRow.RES_UID);
if (check here if resource is a valid resource)
{
updateDs.Resources[0].RES_CODE = "A" + rand.Next(1000, 9999);
Console.WriteLine("Update RES_CODE to " + updateDs.Resources[0].RES_CODE);
resourceSvc.UpdateResources(updateDs, false, false);
Console.WriteLine("Check in " + resourceRow.RES_NAME);
resourceSvc.CheckInResources(new Guid[] { resourceRow.RES_UID }, false);
}
else
{
}
}
tatiana