Adgang til et fil share på et andet Windows NT domæne
Mit problem er følgende: Jeg har en MFC applikation, der skal have tilgang (læse, skrive, oprette) til et antal filer på en maskine der ikke er på det Windows NT (4.0) domæne klient maskinen (4.0 workstation) er logget på. Jeg har forsøgt med NetUseAdd, men får en "Access Violation".
Der er 3 muligheder (måske flere..?): 1) Brug kommandoen runas (kør som)
<Fra Windows help> Runas Allows a user to run specific tools and programs with different permissions than the user's current logon provides. It is good practice for administrators to use an account with restrictive permissions to perform routine, nonadministrative tasks, and to use an account with broader permissions only when performing specific administrative tasks. To accomplish this without logging off and back on, log on with a regular user account and use the runas command to run the tools that require the broader permissions.
runas [/profile] [/env] [/netonly] /user:UserAccountName program
Parameters
/profile
Specifies the name of the user's profile, if it needs to be loaded.
/env
Specifies that the current network environment be used instead of the user's local environment.
/netonly
Indicates that the user information specified is for remote access only.
/user:UserAccountName
Specifies the name of the user account under which to run the program. The user account format should be user@domain or domain\user.
program
Specifies the program or command to run using the account specified in /user. For examples of the use of the runas command starting other Windows 2000 commands, see Related Topics.
2) Du kan også gøre det programmatisk, se fx på funktionen CreateProcessAsUser.
3) Lave dit program som en service, så kan det også køre med andre rettigheder.
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.