Jump to content

Andreas_Hoffmann

Member
  • Posts

    4
  • Joined

  • Last visited

Reputation

0 Neutral
  1. This works Public Shared Sub RemoveUserFromGroup(Group As String, User As String) Dim GroupToConfig As SWConfigDataClientLib.Proxies.Groups.GroupEntry Dim UserToConfig As SWConfigDataClientLib.Proxies.Users.UserEntry GroupToConfig = libManager.GetGroupEnum.AddUserToEnumByName(Group) UserToConfig = libManager.GetUserEnum.AddUserToEnumByName(User) Dim UserIDtoConfig As Int32 = UserToConfig.UserID Dim GroupIDtoConfig As Int32 = GroupToConfig.GroupID Dim GroupList As SWConfigDataClientLib.Proxies.Groups.MembershipEntryCollection GroupList = GroupToConfig.MembershipEntryCollection Dim i As Integer = -1 For Each groupentry In GroupList i += 1 If groupentry.ToString = UserIDtoConfig.ToString & GroupIDtoConfig.ToString Then Exit For End If Next GroupToConfig.MembershipEntryCollection.RemoveAt(i) GroupToConfig.Update(True) End Sub
  2. Hi, my following funktion working fine: Public Shared Sub AddUser(Group As String, User As String) Dim GroupToConfig As SWConfigDataClientLib.Proxies.Groups.GroupEntry Dim UserToConfig As SWConfigDataClientLib.Proxies.Users.UserEntry GroupToConfig = libManager.GetGroupEnum.AddUserToEnumByName(Group) UserToConfig = libManager.GetUserEnum.AddUserToEnumByName(User) Dim UserIDtoConfig As Int32 = UserToConfig.UserID Dim GroupIDtoConfig As Int32 = GroupToConfig.GroupID Dim GroupMapping As = New Proxies.Groups.MembershipEntry With { .GroupID = GroupIDtoConfig, .UserID = UserIDtoConfig, .Position = 0 } GroupToConfig.MembershipEntryCollection.Add(GroupMapping) GroupToConfig.Update(True) End Sub now I want to remove A User and have created a nearly same Sub - only the second last line is changed to GroupToConfig.MembershipEntryCollection.Remove(GroupMapping) nothing happening when I Use .RemoveAll() All Members deleted from group - but i cant remove a single User Any Idea what im doing wrong?? Im no developer an coding j4f like 30 years ago on c128d - thats why i do vb 😀 - no trace implementet yet
  3. Welcome to Swyx Forum :-)

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and have taken note of our Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.