Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. AddAccessRule to Directory for Usergroups of another Domain

AddAccessRule to Directory for Usergroups of another Domain

Scheduled Pinned Locked Moved C#
questionsysadminhelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    Ingo
    wrote on last edited by
    #1

    Well, I'm working on a software which should give rights for usergroups to a directory that is on a fileshare. The usergroup is handled in a domain on a foreign ad-server I can create groups on this ad-server. I can read rights of the fileshare. I can set rights to local groups or groups of my own ad-server But I can't give rights to groups of this other ad-server with his own domains. When I try there comes the error, that he don't know the group. I tried to get the SecurityIdentifier and another error occurs: it says that it's not possible to translate the account. I've tried it that way:

    NTAccount account = new NTAccount("domain\\group");
    SecurityIdentifier secId = (SecurityIdentifier)account.Translate(typeof(SecurityIdentifier));

    This works for group of my own domain (or ad-server) but not for the foreign. Has anyone an idea what to do? By, the way, I tried to change the Thread-User, what seems to work, but no difference:

    string[] roles = { "managers", "executives" };
    Thread.CurrentPrincipal = new GenericPrincipal(new GenericIdentity(user, pwd), roles);

    ------------------------------ Author of Primary ROleplaying SysTem How do I take my coffee? Black as midnight on a moonless night. War doesn't determine who's right. War determines who's left.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups