Hey guys, I'm a senior IT student working an internship, and I am tasked with building an AD linked single sign on authentication module for our site. The short version is that the user is logged onto out network and authenticated to AD, I pull their username, pass it to get-adprincipalgroupmembership, grab the groups, and make a decision as to what areas of the site the user has access to based on their group membership. I have a user class that I want to instantiate a new object for with the username as the object reference. Thus enter the Activator.CreateInstance() method. I'll put up some pseudo-code for you, I can't put actual code up until Tuesday, I can't access our TFS from this side of the firewall.
Code:
String userName = userNameGetter(); //gets the username and stores it in a string
Activator.CreateInstance(UserClass, userName); //this is where it all falls apart. I'm passing it a type and a string,
//but it balks at it and says it isn't the correct overload.
... //some business logic, calls valuesetters based on group membership.