久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

我可以在 .NET 中模擬不同 Active Directory 域上的用

Can I impersonate a user on a different Active Directory domain in .NET?(我可以在 .NET 中模擬不同 Active Directory 域上的用戶嗎?)
本文介紹了我可以在 .NET 中模擬不同 Active Directory 域上的用戶嗎?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我有兩個 Active Directory 域,A 和 B.域 A 中的用戶需要在他們的桌面上運行應(yīng)用程序來查看和操作位于域 B 中服務(wù)器上的資源.每個用戶在域 B 中也有一個帳戶.是否可以模擬每個用戶的域 B 身份以編程方式對域 B 資源執(zhí)行操作?

I have two Active Directory domains, A and B. Users in domain A need to run an application on their desktops to view and manipulate a resource located on a server in domain B. Each user also has an account in domain B. Is it possible to impersonate each user's domain B identity to perform operations on the domain B resource programatically?

示例工作流程:

  1. 用戶登錄到域 A.
  2. 用戶啟動桌面應(yīng)用程序.
  3. 用戶指定域 B 中的資源.
  4. 應(yīng)用程序提示用戶輸入域 B 憑據(jù).
  5. 應(yīng)用程序模仿用戶的域 B 身份來訪問指定的資源.
  6. 用戶使用應(yīng)用程序操作域 B 資源.

推薦答案

我將談?wù)?Win32 API,但我很確定您可以從 .NET 調(diào)用這些 API.檢查 http://pinvoke.net.

I'm going to speak in terms of Win32 APIs, but I'm pretty sure you can p/invoke to these from .NET. Check http://pinvoke.net.

您需要調(diào)用 LogonUser API 來創(chuàng)建代表用戶域 B 憑據(jù)的訪問令牌.

You need to call the LogonUser API to create an access token that represents the user's domain B credentials.

然后您調(diào)用 ImpersonateLoggedOnUser,傳入該訪問令牌.調(diào)用線程將模擬域 B 憑據(jù),直到您模擬一組不同的憑據(jù)或調(diào)用 RevertToSelf API.

Then you call ImpersonateLoggedOnUser, passing in that access token. The calling thread will impersonate the domain B credentials until you impersonate a different set of credentials or call the RevertToSelf API.

我想不用說,為了使 LogonUser 調(diào)用成功,您運行的機器需要信任域 B.

I guess it goes without saying that, for the LogonUser call to succeed, the machine you're running on will need to trust domain B.

這篇關(guān)于我可以在 .NET 中模擬不同 Active Directory 域上的用戶嗎?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

C# ADO.NET: nulls and DbNull -- is there more efficient syntax?(C# ADO.NET:空值和 DbNull —— 有沒有更高效的語法?)
How to set null value to int in c#?(如何在c#中將空值設(shè)置為int?)
How to handle nulls in LINQ when using Min or Max?(使用 Min 或 Max 時如何處理 LINQ 中的空值?)
Asp.net System.Web.HttpContext.Current.Session null in global.asax(Asp.net System.Web.HttpContext.Current.Session 在 global.asax 中為 null)
Caught exception is null itself !(捕獲的異常本身為空!)
Why is it Valid to Concatenate Null Strings but not to Call quot;null.ToString()quot;?(為什么連接空字符串有效但調(diào)用“null.ToString()無效?)
主站蜘蛛池模板: 日韩欧美在线播放 | 亚洲 欧美 在线 一区 | 亚洲一区二区三区四区五区中文 | 91精品国产欧美一区二区成人 | 久久精品一| 免费观看一级毛片 | 黄色成人av | 日韩视频国产 | 波霸ol一区二区 | 欧美激情一区 | 久久另类 | 久久大 | 中文字幕亚洲视频 | 18成人在线观看 | 美女视频一区二区三区 | 亚洲国产精品一区二区www | 国产一级免费视频 | 热久久性 | 国产精品久久精品 | www.成人.com| 国产91丝袜在线播放 | 欧美日韩中文字幕在线 | 色接久久| 99久久99久久精品国产片果冰 | 日本不卡高字幕在线2019 | 国产精品免费一区二区三区四区 | 成人h片在线观看 | 久久精彩视频 | 欧美第一页 | 性生生活大片免费看视频 | 国产精品久久久久免费 | 欧美精品在线一区二区三区 | 欧美日韩电影一区 | 久久久久久亚洲国产精品 | 久久久久国产一区二区三区四区 | 国产一区二区三区在线 | 亚洲精品第一 | 欧美午夜精品理论片a级按摩 | 成人黄色电影免费 | 美女天天干 | 91精品一区二区三区久久久久久 |