Click here to Skip to main content
15,903,012 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questionusing do...loop until Pin
Abbhie2-Oct-07 6:29
Abbhie2-Oct-07 6:29 
AnswerRe: using do...loop until Pin
Colin Angus Mackay2-Oct-07 6:36
Colin Angus Mackay2-Oct-07 6:36 
GeneralRe: using do...loop until Pin
Abbhie2-Oct-07 6:43
Abbhie2-Oct-07 6:43 
GeneralRe: using do...loop until Pin
Volker Weichert2-Oct-07 7:07
Volker Weichert2-Oct-07 7:07 
GeneralRe: using do...loop until Pin
Dave Kreskowiak2-Oct-07 8:11
mveDave Kreskowiak2-Oct-07 8:11 
GeneralRe: using do...loop until Pin
Abbhie3-Oct-07 2:48
Abbhie3-Oct-07 2:48 
GeneralRe: using do...loop until Pin
Dave Kreskowiak3-Oct-07 3:17
mveDave Kreskowiak3-Oct-07 3:17 
QuestionAuthenticating account using PrincipalPermission Pin
archangel_262-Oct-07 4:52
archangel_262-Oct-07 4:52 
Im having issues using PrincipalPermission to authenticate a Windows Domain account. I need to be able to see if a user belongs to a domain group even if they are not the account currently logged into the workstation. Here is the scenario:

A set of users will belong to a group. It is called "group1" . I am attempting to run this code to check if they belong to this group. If so - let them continue. If not, then catch the error. Here is the problem. When I (myaccount) is logged into the machine it authenticates fine for me. It won't authenticate for someone who is a member of Group1 while I am logged into the machine. Even if the other user is a member of group1 and has Administrator rights such as "Otheraccount" does below. The workstation this is running on has the following in the Administrators group:

DOMAIN\myaccount
DOMAIN\otheraccount
DOMAIN\Group1 (myaccount and otheraccount are members of this group)

I am running this code:
'***********************************************************
Dim SecurityCheck As New PrincipalPermission("DOMAIN\"& strUserName, "DOMAIN\Group1")
Dim strError As String

Try
SecurityCheck.Demand()
Catch errormessage As System.Exception
strError = errormessage.Message
If strError = "Request for principal permission failed." Then
MsgBox("You are not a local administrator. You do not have rights to access this software. If you need access, please contact your manager.")
Me.Close
Exit sub
Else
msgbox(strError)
End If

'***********************************************************


Any suggestions? I have tried this as well with the same results:
Dim SecurityCheck As New PrincipalPermission("DOMAIN\"& strUserName, "Administrators")

AnswerRe: Authenticating account using PrincipalPermission Pin
Dave Kreskowiak2-Oct-07 8:09
mveDave Kreskowiak2-Oct-07 8:09 
QuestionSending manually created datatable to SQL server Pin
DA_Loring2-Oct-07 2:02
DA_Loring2-Oct-07 2:02 
AnswerRe: Sending manually created datatable to SQL server Pin
Colin Angus Mackay2-Oct-07 6:38
Colin Angus Mackay2-Oct-07 6:38 
AnswerRe: Sending manually created datatable to SQL server Pin
Dave Kreskowiak2-Oct-07 8:07
mveDave Kreskowiak2-Oct-07 8:07 
QuestionBlock Application Pin
SamRST2-Oct-07 1:36
SamRST2-Oct-07 1:36 
AnswerRe: Block Application Pin
Christian Graus2-Oct-07 2:04
protectorChristian Graus2-Oct-07 2:04 
GeneralRe: Block Application Pin
SamRST2-Oct-07 23:50
SamRST2-Oct-07 23:50 
AnswerRe: Block Application Pin
ESTAN2-Oct-07 2:05
ESTAN2-Oct-07 2:05 
GeneralRe: Block Application Pin
SamRST2-Oct-07 23:50
SamRST2-Oct-07 23:50 
QuestionHow detect IE activity like open, close, and navigate Pin
J. Pan2-Oct-07 1:30
J. Pan2-Oct-07 1:30 
AnswerRe: How detect IE activity like open, close, and navigate Pin
Christian Graus2-Oct-07 2:05
protectorChristian Graus2-Oct-07 2:05 
GeneralRe: How detect IE activity like open, close, and navigate Pin
GuyThiebaut2-Oct-07 5:35
professionalGuyThiebaut2-Oct-07 5:35 
GeneralRe: How detect IE activity like open, close, and navigate Pin
Christian Graus2-Oct-07 10:52
protectorChristian Graus2-Oct-07 10:52 
QuestionBack up Pin
naal_1234562-Oct-07 1:08
naal_1234562-Oct-07 1:08 
AnswerRe: Back up Pin
SamRST2-Oct-07 1:32
SamRST2-Oct-07 1:32 
QuestionAdd-in in VS 2005 does not correctly destroy itself when unloading studio Pin
vj20202-Oct-07 1:06
vj20202-Oct-07 1:06 
AnswerRe: Add-in in VS 2005 does not correctly destroy itself when unloading studio Pin
Dave Kreskowiak2-Oct-07 8:01
mveDave Kreskowiak2-Oct-07 8:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.