Quantcast
Channel: Project Customization and Programming forum
Viewing all articles
Browse latest Browse all 5347

PSI Code to add Forms based Users

$
0
0

Hi,

Want to add the Forms based authenticated user in project server 2010 using PSI.

I am able to add the resource using PSI but when i try to SetResourceAuthorization i am getting an error.

Below is my code:

 SvcResource.ResourceAuthorizationDataSet resourceAuthDs = new SvcResource.ResourceAuthorizationDataSet();
                    SvcResource.ResourceAuthorizationDataSet.ResourcesRow resourceAuthRow = resourceAuthDs.Resources.NewResourcesRow();
                    resourceAuthRow.RES_UID = NewResGuid;
                    if (NTAccountName.Contains("aspnetsqlmembershipprovider"))
                    {
                        resourceAuthRow.RES_IS_WINDOWS_USER = false;                        
                    }
                    else
                    {
                        resourceAuthRow.RES_IS_WINDOWS_USER = true;                        
                    }
                    resourceAuthRow.WRES_ACCOUNT = NTAccountName;
                    resourceAuthDs.Resources.AddResourcesRow(resourceAuthRow);
                    Res.SetResourceAuthorization(resourceAuthDs);
                    System.Threading.Thread.Sleep(2000);


Thanks, Parth



Viewing all articles
Browse latest Browse all 5347

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>