Remove user from store Group

Jun 22, 2009 at 5:01 PM


How could I (in code) remove a user from a store group?

I know how to add them...but i don't see an easy way to remove them.



Jun 22, 2009 at 5:12 PM

Is this correct?

Dim azManDb As New NetSqlAzMan.SqlAzManStorage(dbConnectionString)

'Get the default or only store
Dim myStore As NetSqlAzMan.Interfaces.IAzManStore = azManDb.GetStore(Utils.AzManStoreName)

 'Get the correct storegroup to remove the user
 Dim imyStoregroup As IAzManStoreGroup = myStore.GetStoreGroup(storegroup.ToString())

 'Get my azmanID
 Dim myID As NetSqlAzMan.Interfaces.IAzManSid = GetUserSIDfromDB(user, dbConnectionString)

 Dim myMember As IAzManStoreGroupMember = imyStoregroup.GetStoreGroupMember(myID)




It's unclear to me if the "Delete" method is  the right one to call....thanks again.

Jun 22, 2009 at 5:27 PM

Exactly !

nice work.

Andrea Ferendeles
NetSqlAzMan - Project Coordinator

Jun 23, 2009 at 3:26 PM

Is there an easy way to remove a user from ALL their store groups? (Completely remove user from system)

My users could be in 1 up to 10 store group. I could:

1) iterate through all the store groups

2) check if member

3) Remove...


I'm just wondering if it could be easier.



Jun 23, 2009 at 5:47 PM

Hi cmacholtz,

using NetSqlAzMan.dll … yes .. it is the unique way.

If you want you can use a T-SQL statement like this:



FROM         netsqlazman_StoreGroupMembersTable

WHERE     (objectSid = SUSER_SID('MY DOMAIN\My user'))


FROM         netsqlazman_ApplicationGroupMembersTable

WHERE     (objectSid = SUSER_SID('MY DOMAIN\My user'))


Andrea Ferendeles
NetSqlAzMan - Project Coordinator