Guid guid = Marshal.GenerateGuidForType(typeof(IServerEnvironment));

UID uid = new UIDClass();

uid.Value = guid.ToString("B");

IEnvironmentManager environmentManager = new EnvironmentManager() as IEnvironmentManager;

IServerEnvironment2 serverEnvironment = environmentManager.GetEnvironment(uid) as IServerEnvironment2;


string
userName = serverEnvironment.UserInfo.Name;


IEnumBSTR
roles = serverEnvironment.UserInfo.Roles;

string role = roles.Next();

do

  role = roles.Next(); 

while (role != null);

 


Leading Cloud Surveillance service

Leading Enterprise Cloud IT Service Since 2003

Powered by FirstCloudIT.com, a division of DriveHQ, the leading Cloud IT and Cloud Surveillance Service provider since 2003.