View Single Post
Old 11-21-2009, 09:36 AM   #3 (permalink)
sr75
New Member
 
Join Date: Nov 2009
Model: 8100
PIN: N/A
Carrier: t-mobile and at&t
Posts: 1
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default My Fix

Quote:
Originally Posted by BES admin View Post
If our help desk creates a new users on the BES I'd like to see those new users automatically get assigned to a default group. Our help desk is allowed to add users to the BES, however, until those new user(s) are added to a group, those new users are unavailable (Can't be viewed or edited) to the Help Desk staff because the new users are "groupless."

This is a direct result of specifying that the help desk staff can only edit & view users in specific groups, (Which apparently precludes them from viewing users who don't yet belong to a group) yet during the process of adding a user to the BES, the help desk staff can't specify the group the new user should belong to.

My goal is to prevent the help desk staff from viewing or editing users in one particular "Presidential Cabinet" group, while allowing them to add, edit, and update new users in other groups or users not in a group yet. .


I had the exact same issue. Only I have multiple subsidiary companies that have their own level 1 help desks. I created my own stored procedure on the BES Database and I run a SQL task every 5 minutes to run that stored procedure.

The stored procedure creates a temporary table in memory that is populated by
users that are not currently assigned to groups. It will then add those users to the New User Group. Any actions done to the temporary table only effects the temporary table and not your actual data. The temp table is destroyed when the stored procedure finishes.

<<<<<<<<<<<<<<<<<< CLIP >>>>>>>>>>>>>>>>>>>>>>

CREATE PROCEDURE sp_MoveToUserBucket
AS

BEGIN
DECLARE @tmpGroupless TABLE(GroupId INT,UserId INT)
DECLARE @ROWCOUNT INT
DECLARE @iGroupID INT
DECLARE @iUserID INT

/* Change the @iGroupID to the GroupID of the Group being used for the bucket. You can find the Group ID in the dbo.BASGroupNamesV View */

SET @iGroupID = 14

INSERT INTO @tmpGroupless
Select dbo.BASGroupMemberships.GroupId, dbo.BASUsers.UserId
FROM dbo.BASGroupMemberships
FULL JOIN dbo.BASUsers
ON dbo.BASGroupMemberships.MemberID=dbo.BASUsers.User ID
WHERE dbo.BASGroupMemberships.GroupID is NULL

SELECT @ROWCOUNT = @@ROWCOUNT

WHILE @ROWCOUNT > 0
BEGIN
SET @iUserID = (SELECT TOP 1 UserID FROM @tmpGroupless)
BEGIN
INSERT INTO dbo.BASGroupMemberships
VALUES (@iGroupID, @iUserID, 1, 0)
BEGIN
RAISERROR('Adding New User failed to add to User Bucket.',16,1)
END
END
DELETE FROM @tmpGroupless where UserID = @iUserID
SET @ROWCOUNT = @ROWCOUNT -1
END
END
Offline   Reply With Quote