Getting list of all users in Superuser role

Hello,

I need a way to return a list of all the UserID's for the Superuser role. I tried using GetUsersInRole but it looks like this function is only for "regular" roles. For example :

Public Function GetUserIDsInSuperuserRole(ByRef PortalID As Integer) As ArrayList
    Dim arrUsers As New ArrayList
    Dim objRoles As New DotNetNuke.Security.Roles.RoleController
    For Each objUser As DotNetNuke.Entities.Users.UserRoleInfo In objRoles.GetUsersInRole(PortalID, glbRoleSuperUser)
        arrUsers.Add(objUser.UserID)
    Next
    Return arrUsers
End Function


The above function returns :

Provider role not found: -2 ---> System.Exception: Provider role not found: -2

The -2 is the role ID for Superusers. Any ideas?


Presstopia.Com
0
Presstopia
11/13/2005 6:24:05 PM
asp.net.dotnetnuke-modules 4559 articles. 0 followers. Follow

2 Replies
1595 Views

Similar Articles

[PageSpeed] 55

You will need a query to do this.

SELECT     dbo.Users.*
FROM         dbo.Users
WHERE     (IsSuperUser = 1)
Leigh Pointer
User Group Champion
» Evangelising DotNetNuke Everywhere «

0
Leigh
11/13/2005 7:53:04 PM
Hi Leigh, I just discovered a function called GetSuperUsers() in
DotNetNuke.Entities.Users.UserController which seems to do what I need.
Thanks for replying though.

Presstopia.Com
0
Presstopia
11/13/2005 8:06:32 PM
Reply:

Similar Artilces:

Problem : Get a list of user belonged to a role or to know if a user already has a role
What code can I write to know if a user belonged to a Role already ? and How can I get a list of a  user already in an existing role ? Please have a look at my code below : Protected Sub AddUsers_OnClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAddUsersToRole.Click' I wanna add some code here to check if a user already belonged to a Role' Please insert your code here. Thanks a lot. ' A role must be selected If RolesListBox.SelectedItem Is Nothing Then Msg.Text = "Please select a role." Exit Sub End If ...

Get list of users assigned to a specific role
I have a role called Contractor...  In code, I need to get the list of all users assigned to this role for display in a Drop Down List...  Can someone provide me a sample set of code for doing this using DNN objects...  Thanks...  This should get you started. You can then bind to a ddl or an array. Just replace the RoleId with that of the Contractor roleid. Dim objUser As new UserController objUser.GetRoleMembership(PortalId, RoleId, UserId)...

how can i write this line using vb.net: List<User> myList = new List<User>();
and which package i need to import System.Collections.GenericDim myList as new List(Of User) If this post is useful to you, please mark it as answer. avi999912: and which package i need to import Hi, If searching in MSDN, you will get this page: http://msdn.microsoft.com/en-us/library/6sh2ey19.aspx, in which, you can find the package at the Namespace subject. .NET Framework Class Library List(T) Class Represents a strongly typed list of objects that can be accessed by index. Provides methods to search, sort, and manipulate lists. Namespace:  System.Collections...

Getting a list of USERS from an NT USER GROUP
Dear Beginners, I have a small task of getting NT user list from a NT USER GROUP. Please suggest me.. Thanking you.... With Regards Rajuveera coincidently, i had to do the same thing yesterday... i used Win32::AdminMisc module, which you can obtain from www.roth.net the docu is good, so it should all explain itself from there. if your'e still stuck after installing, msg me, i'll send you some sample code. regards, Jos ----- Original Message ----- From: "Veeraraju_Mareddi" <rajuveera@satyam.com> To: <beginners@perl.org> Cc: <perl...

How Get proxy users lists for Every GW Users ??
How i can get 1. Proxy users list for every GW users ? 2. Proxy users lists Right for every GW users ? GW7Sp1. Serg Doesn't TID 10050654 still work ? Cheers Dave -- Dave Parkes [NSCS] Occasionally resident at http://support-forums.novell.com/ > Doesn't TID 10050654 still work ? > > Cheers Dave Thank you, Dave. Will be read and test this. Serg It should still work Cheers Dave -- Dave Parkes [NSCS] Occasionally resident at http://support-forums.novell.com/ Try this.... Demo version can report it... http://eng.itq.dk/default.a...

Removing user from list of users list
Hi,=20 I have the following situation: A user who has been creating, testing, commenting bugs does not work here any more, I have already to delete but this will result in an inconsistency in the database or the bugs he has been involved in will not be displayed.=20 I just want that from now on his user does not appear among the list (assigned or CC).=20 Is there any way to do so? Thanks Cinthya cinthya.kamberi@nokia.com escribi�: > I have the following situation: > > A user who has been creating, testing, commenting bugs does not work > here any more, I ...

can`t get role list from role sub-container
In Designer UserApplication->Role Catalog->Roles->ITRole I create several "Role Sub-Container". There are several roles in each sub-container. What I want to do is to get "roleSubContainer1" role list in User Application request form dynamically. I log in as userApplicationAdmin with full rights on all tree. The problem is I can't get role list. I cant select "roleSubContainer1" container via DNLookup, it`s not visible. IDVault.containers() seems good, but if returns containers only. Role item is not a container. IDVault.globalQuer...

Problem with FreeTextBox on a Module with similar functionality to Editing Users and User Roles
  Hi,   I'm trying to design a module and I'm getting an error message when I open the page.  The error message is:-   Error: A Runtime error has occured. Do you wish to debug? Line: 39 Error: Expected ';'   The issue I have is:-   I have a normal module page that is displaying a list of clients.   I can then edit the clients details by moving to the edit page.   On the edit page, I can further edit some details of the client.  At the bottom of the page, I have an edit button, and it runs this code:-   Response.Redirect(Navig...

Can I get a listing of users that use the NW 6 user license
NW 6.5 SP5, iManager, I can see each license (5 user count) and check the Unit in use which will show me the users that are using that license. However, I have over 30 license objects because each object has 5 user count. Is there a way I can get the listing without having to go through the 30 objects? Thanks NW Admin nwadmin@domain.com wrote: >Is there a way I can get the listing without having to go through the 30 >objects? If your license files are in a common license container, then simply check the properties of the license container. It will show you the combi...

User of Roles in Modules
"Just Food for Thought" that I wanted to pass on to module developers. Several modules on the market make use of the user roles above and beyond the core security model.  One common problem that I see in some of these module is that most tend to forget about the Role expiration date.  This is especially true for applications such as Newsletter applications as well as any other application that uses roles to select a group of members.  I have found this even in some of the Core Modules.  So far I have not found any that posed a direct security risk but I could see whe...

how to get all user by role
how can i get all user by roleName in asp.net role base provider? Provided you have the role provider set up in your web.config the following code would work. Dim Users() As String = Roles.GetUsersInRole("RoleName") For Each UserName As String In Users Response.Write(UserName) Next...

User Roles modules
Are there any modules out there that creates a simple list of what roles each users are in? For example if i click on Role1 it would show all the users in role1 and then Role2 all users in Role2. Thanks psidrum, That is built into the DNN Core. Go to Admin--> Security roles. Click on the Edit icon to edit the role, and then click on "Manage Users in this Role" link this will give you a list of the users in the role. DotNetDocwww.DotNetDoc.comGet the Book!!...

Module to list users
I'm looking for a module to list the users registered with my site. Is there something like this built in or commercially (or freely) available? You can do that in the Admin/Users section. Are you talking about 2 or 3 installation. Nina MeiersNina Meiers Sorry, I wasn't very clear. I'm looking for something to make a user directory on the actual site based on registered users. Easiest thing to do would be to get my Advanced DataGrid Module and do a Select x, x, .. from Users.David O'Learywww.EfficionConsulting.com Turek, I also have a module that lets you do the same thing i...

How to get list of users?
How can i get list of users and roles within my code? I mean i guess i could SqlDataReader to read in usernames, but is there easier way to do so? MembershipProvider?p.s. user management database is created using aspnet_regsql (standard aspnetdb)  Thanks using System.Web.Security; ... MembershipUserCollection users = Membership.GetAllUsers();string[] roles = Roles.GetAllRoles(); I think this works   edit: if not, your web.config may need to be altered to tell asp where to find the info (SQL Server)...

List all users and the role they are in
The users can only be in one role. So i want to list all the users and the role. This is what i have now, but i need the role aswell. Anyone now how to do that. Do i need to write my own procedure?? <asp:ObjectDataSource ID="userId" runat="server" TypeName="System.Web.Security.Membership" SelectMethod="GetAllUsers" DeleteMethod="DeleteUser"> </asp:ObjectDataSource> It's fairly easy as the role and member classes have static methods to do trhe work. Try this foreach (string role in Roles.GetAllRoles()) { string[] usersInRole = Roles.GetUsersInRole("RoleName"); }If it wa...

get user role..
Dim currentrole As String = Roles.GetRolesForUser It will not let me write this, but I am trying to assign the current users role to the variable currentrole..   could anyone help me? http://msdn.microsoft.com/en-us/library/ms998314.aspxAvantha SiriwardanaBeware of bugs in the above code; I have only proved it correct, not tried it. (Donald Knuth) Hi mattatuni2, It's probably caused by missing namespace. Please try to add namespace "System.Web.Security" first. Thanks.David QianMicrosoft Online Community SupportPlease remember to mark the replies as answers if th...

DotNetNuke: How to view user control Module by giving control Key in module definition
 I'm not viewing the usercontrol page when I'm giving Control key name in the module definition. but its shows if not giving control key name.I want to navigate from one user control page to another page module..I've written the coding as shown in below.. Response.Redirect(Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "ControlKeyValue", "mid=" + ModuleId.ToString())); Its showing blank page when I'm executed...can anyone help me to solve this problem..?Thanks in advance..!Muthupandian ...

Get all user by roles
I have some problem that I want every body help me. Example: I have 2 roles as "Student" & "Teacher". In this role have more memership. I would select all users that have role "Student" & have role "Teacher".  Do you have any solution?  Thank you,Thank you,IT Manager  Roles.GetUsersInRole("Student"); Roles.GetUsersInRole("Teacher"); If this post was useful to you, please mark it as answer. Thank you!Regards.mimranshafiq.NET Web Developerhttp://www.dotnetclassic.com Thank you for your su...

How to get a list of users
I use windows authentication in my project with vb.net. Is there a way to get a list of all looged in users in my project? You need to keep a list of logged in Users using Session Start and Session End events in the Global.asax. Be carefule to implement in your design the scenario of same user logging in twice.   You can have a hashtable stored in Application object or your custom class collection to keep this info.ASP.Net Tips & Tricks - Jawad's Blog Can you be a more specific please? Can you give example because i am not experienced? Here is an example... It does much mroe the...

Dot Net Nuke (DNN)
Normal 0 false false false MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-b...

Manage Users For This Role / Manage Roles For This User Question
In the roles/user management pages there is a link called Manage Users For This Role and Manage Roles For This User respectively. I want non Admins to be able to see these pages, and currently I have it so that they can see the manage users and manage roles pages. However, when a non admin clicks on Manage Users For This Role or Manage Roles For This User link it does not display the control, just an empty page. I can get around this by giving edit rights to the page, but I do not want them to have edit rights for the page. Any ideas? Thanks  ...

Does the Page_Load get processed for ALL ROLES or just those w/View capabilities, and if so, then how/where to put code in a module *BEFORE* View Roles are processed?
Hey folks.  I'm confused.  I'm trying to create an tab urlredirecter to offer to the community w/source (since magicgadget is gone).  So obviously I need to have a module that gets processed on any page it's placed.  However, I don't want it to be visible. Now I see on Module Settings that there are two settings: Visibility? Min/Max/None Display Container?  Yes or No I'm a bit confused by the difference of these two.  So let me see if I have this correct.  If I set the 'visibility' to 'None', this will accomplish what I want?  It will be...

List of all users On-Line, not a count, a list of user names
We are using Microsot Membership, role, profiles in out web application.  We would like to get a list of just the users who are logged in using the (IsOnline) of the memberhsip. We can create a gridView and tie its data source to the GetAllusers of the membership class but  then we get all 600+ users not just th 10-25 who ar "on-Line". We understand that "on_line" may not be exact but it would be better that having nothing. Is there someway to restict the getAllusers method to just show users with a (onLine) of true. Is there a better approach? Th...

Programmatically get user role?
I've just started ASP .NET with C#, and would like to programmatically make it so if a user creates an account or signs in, they get forwarded to a different page. However, I would like to send Admin users to "./Admin/Admin.aspx" and regular users to "./User.aspx".  I figure that if i could put a simple if statement in the ContinueButton_Click function of the final step of createuserwizard or the login button... But I don't know how to find out if the user name is Admin or not...  Any help would be greatly appreciated...   thx.. Initially your user won't have a role assi...

Web resources about - Getting list of all users in Superuser role - asp.net.dotnetnuke-modules

Superuser - Wikipedia, the free encyclopedia
In computing, the superuser is a special user account used for system administration . Depending on the operating system, the actual name of ...

superuser.com « Blog – Stack Exchange
Well, Windows 8 is finally available in the wild . Of course, developers have had access to it for quite a while – our ongoing Apptivate contest ...

ClockworkMod Superuser now integrated into CyanogenMod
/ Towards the end of February Koushik Dutta, best known as the author of ClockworkMod Recovery, released a new superuser access app called ClockworkMod ...

ClockworkMod Superuser app now available in the Google Play Store
Koush's ClockworkMod Superuser is now available to download for free from the Google Play Store

CyanogenMod 12 Will Integrate Superuser Settings With The Privacy Guard System, No Separate SU App Necessary ...
Most of the news about CyanogenMod over the last month or so has been about Cyanogen Inc.'s very public spat with enthusiast manufacturer OnePlus. ...

Critical code execution bug in Samba gives attackers superuser powers
Vulnerability can be exploited by sending malicious NetBIOS traffic.

Official Superuser app available for rooted Android devices
... like Carbon, ROM Manager and the popular ClockworkMod custom recovery, has released a new open-source root access management app called Superuser. ...

Founder Stories - Jess Lee’s Journey From Polyvore Superuser to CEO
MOUNTAIN VIEW, United States — While working for Marissa Mayer as a product manager at Google, Jess Lee became an obsessive user of a recently ...

"Superusers" clogging U.S. emergency rooms, studies suggest
Most people go to the emergency room only when necessary, but a small percentage account for the majority of ER visits

Koush’s Superuser App Hits Google Play – Open Source, Secure, and Powerful
This morning, Koush launched his all new Superuser application to Google Play. Just last week, Koush detailed why there needed to be another ...

Resources last updated: 2/16/2016 12:00:36 PM