473,399 Members | 3,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

WinNT: User Group verification in a .vb class?

Hi all I greatly appreciate your time and help if possible.
I'm currently using User.IsInRole("Group_name") to find out if the logged
in user belongs to a certain NT User Group. For some reason I can do this
only in the .aspx form and not in a class. I would like to write a function
in a common .vb class that can call the WinNT local users and find out if
current user belongs to a certain group.
Thanks for your help.

V
Jul 21 '05 #1
4 2834
Actually my code doesnt work. I'm using Forms Authentication to log in using
a windows local user account. The user.isinrole is always false. Please help.

"Victor" wrote:
Hi all I greatly appreciate your time and help if possible.
I'm currently using User.IsInRole("Group_name") to find out if the logged
in user belongs to a certain NT User Group. For some reason I can do this
only in the .aspx form and not in a class. I would like to write a function
in a common .vb class that can call the WinNT local users and find out if
current user belongs to a certain group.
Thanks for your help.

V

Jul 21 '05 #2

"Victor" <Vi****@discussions.microsoft.com> wrote in message
news:05**********************************@microsof t.com...
Hi all I greatly appreciate your time and help if possible.
I'm currently using User.IsInRole("Group_name") to find out if the logged
in user belongs to a certain NT User Group. For some reason I can do this
only in the .aspx form and not in a class. I would like to write a
function
in a common .vb class that can call the WinNT local users and find out if
current user belongs to a certain group.
Thanks for your help.

V


Please post a repro that illustrates the problem, without that we can't help
you out.

Willy.
Jul 21 '05 #3
I figured out what the problem is. I had Anonymous Authentication enabled, so
I couldnt find out what NTGroups the current user belongs.
I'm pulling out user info from ADSI. The code is:

Dim ADGroups, ADGroup As Object
Dim strAdmin as Boolean
Dim ADEntry As New DirectoryEntry("WinNT://DEV2K/administrator")

ADGroups = ADEntry.Invoke("Groups")
For Each ADGroup In ADGroups
If ADGroup.Name = "CMSAdministrator" Then
strAdmin = True
End If
Next
"Willy Denoyette [MVP]" wrote:

"Victor" <Vi****@discussions.microsoft.com> wrote in message
news:05**********************************@microsof t.com...
Hi all I greatly appreciate your time and help if possible.
I'm currently using User.IsInRole("Group_name") to find out if the logged
in user belongs to a certain NT User Group. For some reason I can do this
only in the .aspx form and not in a class. I would like to write a
function
in a common .vb class that can call the WinNT local users and find out if
current user belongs to a certain group.
Thanks for your help.

V


Please post a repro that illustrates the problem, without that we can't help
you out.

Willy.

Jul 21 '05 #4
Hi Victor,

I need to just capture NT user, Domain and IP from my VB.NET application,
Please let me know, if U have solution.

Regards,
Mustaq
"Victor" wrote:
I figured out what the problem is. I had Anonymous Authentication enabled, so
I couldnt find out what NTGroups the current user belongs.
I'm pulling out user info from ADSI. The code is:

Dim ADGroups, ADGroup As Object
Dim strAdmin as Boolean
Dim ADEntry As New DirectoryEntry("WinNT://DEV2K/administrator")

ADGroups = ADEntry.Invoke("Groups")
For Each ADGroup In ADGroups
If ADGroup.Name = "CMSAdministrator" Then
strAdmin = True
End If
Next
"Willy Denoyette [MVP]" wrote:

"Victor" <Vi****@discussions.microsoft.com> wrote in message
news:05**********************************@microsof t.com...
Hi all I greatly appreciate your time and help if possible.
I'm currently using User.IsInRole("Group_name") to find out if the logged
in user belongs to a certain NT User Group. For some reason I can do this
only in the .aspx form and not in a class. I would like to write a
function
in a common .vb class that can call the WinNT local users and find out if
current user belongs to a certain group.
Thanks for your help.

V


Please post a repro that illustrates the problem, without that we can't help
you out.

Willy.

Jul 22 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Dirk Hagemann | last post by:
Hi! I'm using this code to list all computers of our WinNT-Domains: import win32com.client from pprint import pprint as p domain='domainX' auswahl='computer' def enumerate(domain,auswahl):...
8
by: Hakan | last post by:
I use the following code to check if a user is an admin in the login page of our intranet. Set User = GetObject("WinNT://" & UserDomain & "/" & UserName & ",user" For Each Group in User.Group...
1
by: Vijay Mehta | last post by:
Hi.. How to get winnt login user properties like address,phoneno, email etc. With regards, Vijay Mehta
4
by: Thomaz | last post by:
In VB, I can write the following code to get the list of users and groups in the domain ASIA. How do I do the same in C# Set objContainer = GetObject("WinNT://ASIA") objContainer.Filter =...
1
by: Bob | last post by:
I'm all of a sudden getting an access denied error on my web server when I access it from a browser: CS0016: Could not write to output file 'c:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary...
1
by: Matthias Mohr via .NET 247 | last post by:
Hello, I'm trying to get Users that belong to a group with the WinNT Provider in an ASP.NET environment. I found several examples to do this under ASP using the GetObject-Method...
4
by: Victor | last post by:
Hi all I greatly appreciate your time and help if possible. I'm currently using User.IsInRole("Group_name") to find out if the logged in user belongs to a certain NT User Group. For some reason I...
3
by: sheldonlg | last post by:
I don't think my last attempt posted so here it is again. This is a bit off-topic, but it does relate to php. This is the most active related group that I can find, so even if it is off-topic I...
2
by: Don Rich | last post by:
Please share with me any ideas you may have for troubleshooting and resolving the subject problem. I can give more details as necessary. (Please advise if I should post this problem to a more...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.