Re: Role based security on local machine

From: Nicole Calinoiu (calinoiu)
Date: 04/29/05


Date: Fri, 29 Apr 2005 10:21:11 -0400

The "MACHINENAME\GroupName" syntax doesn't even work for me on the local
machine when logged on with a domain account (the scenario that supposedly
works for OP), which is why I thought the named machine might not be the
local machine. It might actually be a domain name rather than a machine
name, but only OP knows for sure...

"Dominick Baier [DevelopMentor]" <dbaier@pleasepleasenospamdevelop.com>
wrote in message news:327078632503871272547536@news.microsoft.com...
> Hello Nicole Calinoiu" calinoiu REMOVETHIS AT gmail DOT com,
>
> IMO you can't call IsInRole on a remote machine.
>
> ---------------------------------------
> Dominick Baier - DevelopMentor
> http://www.leastprivilege.com
>
>> Is the "MACHINENAME" from your sample code the name of the local
>> machine or another machine on the network? If it's the local machine,
>> try using the "BUILTIN\Administrators" syntax instead. If it's not
>> the local machine, is it possible that your local account doesn't have
>> permissions to access the target machine at all?
>>
>> "Diane" <dweaver@hcd.net> wrote in message
>> news:1114774743.636573.247460@o13g2000cwo.googlegroups.com...
>>
>>> I am testing role based security and have a problem when logged into
>>> the local machine. It always fails when I specify a group instead of
>>> a user name. Everything works fine when I'm logged into the domain.
>>> I'm running it on an XP machine. Following is the code:
>>>
>>> Dim currentDomain As AppDomain = AppDomain.CurrentDomain
>>>
>>> currentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal)
>>>
>>> Dim myIdentity As WindowsIdentity = WindowsIdentity.GetCurrent Dim
>>> myPrincipal As New WindowsPrincipal(myIdentity)
>>> Thread.CurrentPrincipal = myPrincipal
>>>
>>> Dim myPermission As New PrincipalPermission(Nothing,
>>> "MACHINENAME\Administrators")
>>>
>>> Try
>>> myPermission.Demand()
>>> MessageBox.Show("Welcome to the show! You have access!")
>>> Catch ex As Exception
>>> MessageBox.Show("Get out of here! You don't have access!")
>>> MessageBox.Show(ex.Message)
>>> End Try
>
>
>



Relevant Pages

  • RE: Domain?
    ... Integrated Windows authentication is a secure form of authentication ... network. ... doesn't where it should check the domain account. ... So for your scenario, I'd suggest you can add this box into the domain. ...
    (microsoft.public.inetserver.iis.security)
  • RE: MOSS 2007 RSS Viewers XSL Link not working
    ... I tested with a domain account which are both of admin on the servers, ...
    (microsoft.public.sharepoint.portalserver.development)

Quantcast