Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
I have a single class that I supply the user name, domain name, and password too... the idea is to get that class to run in the context of the information supplied to it. The main program does not need that level of access so the idea is not to use the 'run as' command or demand that the whole program has that level of access...only this one class needs it, is there a way to do that?
Posted (edited)

The only way I see it's to wrap yor class as COM and add it to the COM+ Service... There you can specify the security context you want it to run...

 

The System.EnterpriseServices namespace does that for you...

 

I really don't know any other way...

 

Alex :p

Edited by AlexCode
Software bugs are impossible to detect by anybody except the end user.
Posted

Thanks for the reply. I read most of that stuff on MSDN before. The problem I have with impersonation is that the .NET methods don't work on 2000 unless you make the computer not secure... in the past I've always used the advapi LogOnUser function. I'm trying to avoid starting a whole new process in the background for this one function, but it looks like I may have to - I can't seem to find anything that will just run a certain function in the context of a user without use the .NET impersonation which doesn't work on 2000... those dang security classes descriptions can be so vague at times though it could be a snake that would've bit me by now too....

 

The next problem I've had is that the wrapper I made for the LogOnUser for trying to do it as seperate process never seems to work in I think it's called 'Network Mode'... it's one of the flags, basically instead of validating with the local authority it validates when the code is run (for working across domains where no trust is established).... and the other mode that works is actually logging the user into the whole computer (create a profile folder if not one present, etc....) whichis fine, but I need the network mode... I'll keep at it and maybe I'll figure out something, I can send that wrapper class if your interested in taking a look at it. Thanks for the help though.

Posted

But is COM+ infrastructure out of the question?

Cause this kind of do a lot of work for you in that base...

 

You can send me that class and I'll take a look at it... you can even contact me thru MSN Messenger if you will...

 

Alex :p

Software bugs are impossible to detect by anybody except the end user.
Posted
But is COM+ infrastructure out of the question?

Cause this kind of do a lot of work for you in that base...

 

You can send me that class and I'll take a look at it... you can even contact me thru MSN Messenger if you will...

 

Alex :p

When I get in to work tomorrow I'll try to PM you the class... I'll pop it up in a zip file on my server or something... I'll have to read up on COM+... I'm what I'm trying to do is possible, it's just a matter of in-experiance...as often is the case...thus I don't know of it...

Posted

Do that...

 

Meanwhile... search on the net (MSDN & Google) for the System.EnterpriseServices namespace.

 

It's not hard... it's just a matter of implementing the interface and 80% of the work is donne!

 

Alex :p

Software bugs are impossible to detect by anybody except the end user.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...