473,545 Members | 2,073 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2851
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****@discuss ions.microsoft. com> wrote in message
news:05******** *************** ***********@mic rosoft.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 = "CMSAdministrat or" Then
strAdmin = True
End If
Next
"Willy Denoyette [MVP]" wrote:

"Victor" <Vi****@discuss ions.microsoft. com> wrote in message
news:05******** *************** ***********@mic rosoft.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 = "CMSAdministrat or" Then
strAdmin = True
End If
Next
"Willy Denoyette [MVP]" wrote:

"Victor" <Vi****@discuss ions.microsoft. com> wrote in message
news:05******** *************** ***********@mic rosoft.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
4539
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): adsi = win32com.client.Dispatch("ADsNameSpaces")
8
12914
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 Select Case Group.Nam Case "Domain Admins Session("Admin")=Tru Case "Domain Users Session("User")=Tru End Selec
1
3584
by: Vijay Mehta | last post by:
Hi.. How to get winnt login user properties like address,phoneno, email etc. With regards, Vijay Mehta
4
14028
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 = Array("user", "group") For Each user In objContainer List1.AddItem user.Name Next
1
1675
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 ASP.NET Files\projmgmt\ede965f0\db1b3c5e\thwdzsif.dll' -- 'Access is denied. ' I understand that .NET was attempting to do a JIT compilation since...
1
1902
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 (GetObject("WinNT//:Domain/...). But how does it work in VB.NET? Can I use the GetObject-Method, or is the usage of DirectoryServices or ADSI the right way?An...
4
355
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 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...
3
2564
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 hope you can help. (I have posted to alt.comp.mail.qmail, but that doesn't have much participation). Goal: I want the create an account in...
2
1487
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 specific group.) Here's the situation in a nutshell. We're using WinXP Pro workstations configured to a common standard on a nation-wide...
0
7405
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7659
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7760
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5334
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4949
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3455
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3444
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1887
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1019
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.