473,396 Members | 2,029 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,396 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 2833
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.