|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Creating Folders and SecurityHi
On the company server, there is a folder for each client. This folder should be named after the Clients 6 digiit ID. At the moment, the folders are created manually by users. Of course, this leads to errors. So I'd like to write a program that creates the folder. Just use My.Computer.FileSystem.CreateDirectory will work fine, except for one issue. I want to change the permissions on the server so that users can't create folders manually. This also means the program won't work. Is there something in VB that I have the program use admin permissions, so that it will create the folder irrespective of the users rights? Thanks Vayse You can't override the security mechanisms of Windows, but, you can use
impersonation with an account with sufficient permissions to create the directories. Look into the System.Security.Principal.WindowsImpersonationContext class. There are a ton of example online. Jared Show quoteHide quote "Vayse" wrote: > Hi > On the company server, there is a folder for each client. This folder should > be named after the Clients 6 digiit ID. > At the moment, the folders are created manually by users. Of course, this > leads to errors. > So I'd like to write a program that creates the folder. Just use > My.Computer.FileSystem.CreateDirectory will work fine, except for one issue. > I want to change the permissions on the server so that users can't create > folders manually. This also means the program won't work. > Is there something in VB that I have the program use admin permissions, so > that it will create the folder irrespective of the users rights? > > Thanks > Vayse > > > "Vayse" <vayse@deadspam.com> wrote in Use impersonation to impersonate an admin account to set the folder news:O9Z4XgCyGHA.2400@TK2MSFTNGP03.phx.gbl: > Is there something in VB that I have the program use admin > permissions, so that it will create the folder irrespective of the > users rights? security.
One Last Class Question - Example that works
DirectX rendered inside a control? problem save and reading from the registry Q: deleting relations Using SQLDataSource without a control? Problems with SaveAs Database Current namespace, stack and lineno How to make double click event to call and execute the mouseup event code I/O Access through window handle? |
|||||||||||||||||||||||