Using 2017 R2 SDK and VMS.
On a 2012 server I have users that are members of an AD group - 3 groups specifically.
When one of those users has logged in to the VMS I can get the users login settings via the
VideoOS.Platform.Login.LoginSettingsCache.LoginSettings
property.
This gives me a list of users login details. One of the details of the LoginSettings class is GroupMemberShip. According to the SDK documentation this field would be populated with the AD group id, but I don’t get any results in this field - just an empty string array.
Is the field expected to be populated as I am expecting?
I will do some in-house testing here at Milestone Support.
I’ve been informed that there will be a fix for this 2018 R1.
@Bo Ellegård Andersen (Milestone Systems)
Thank you for looking into this issue.
I can confirm this fix in 2018 R1.
Thank you Bo.
My next question is directly related to this issue so I didn’t bother to create a new post and resurrected this older one.
Is there a method where I can get the ‘display name’ from a GUID when a GUID is returned? I’d like to use the display name for filtering if possible.
Yes. You can find the Role, having the GUID, using the Configuration API.
See how I find a GUID from my test system using the ConfigAPI Client:
I tried it.
You might find this code interesting.
private void button1_Click(object sender, EventArgs e)
{
var l = VideoOS.Platform.Login.LoginSettingsCache.LoginSettings;
string[] gmss = l.FirstOrDefault().GroupMemberShip;
label1.Text = "Group memberships: ";
foreach(string gms in gmss)
{
label1.Text += gms+ " -/- ";
}
try
{
ManagementServer ms = new ManagementServer(VideoOS.Platform.EnvironmentManager.Instance.MasterSite);
var roles = ms.RoleFolder.Roles;
foreach (var role in roles)
{
label1.Text += Environment.NewLine;
label1.Text += role.DisplayName + " " + role.Description + " " + role.Id;
}
}
catch(Exception ex)
{
label1.Text += Environment.NewLine;
label1.Text += "Exception happened: " + ex.Message;
}
}
Thank you Bo.
Works perfectly for my needs.