获取 Active Directory 中的打印机是否受到限制
我创建了一个与 AD 通信的 C# 应用程序,我想从属性及其一段代码中获取打印机是否受到限制,
deSearch.Filter = String.Format("(&&&(objectClass=printQueue)(printerName={0})(location={1})(driverName={2})))", queueName,location,modelNumber);
SearchResultCollection results = deSearch.FindAll();
foreach (SearchResult result in results)
{
string Description = result.Properties["description"][0].ToString().Trim();
//how I can get here if this printer is restricted or not
}
我还在打印机属性中找到了 nTSecurityDescriptor 属性。它对我有帮助吗?或者可以获取打印机属性限制与否?
注意它是在.Net Framework 3.5下
欢迎所有想法
I create a C# application that communicate with AD and I want to get if the printer is resticted or not from properties and its a piece of code here
deSearch.Filter = String.Format("(&&&(objectClass=printQueue)(printerName={0})(location={1})(driverName={2})))", queueName,location,modelNumber);
SearchResultCollection results = deSearch.FindAll();
foreach (SearchResult result in results)
{
string Description = result.Properties["description"][0].ToString().Trim();
//how I can get here if this printer is restricted or not
}
I also found nTSecurityDescriptor attribute in printer attributes .Is it helpful for me or is can get if printer restricted or not?
Note Its under .Net Framework 3.5
All ideas are welcomed
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您应该使用
System.Drawing.Printing.PrintingPermission
此处< /a> 有一个使用它的示例。I think you should use
System.Drawing.Printing.PrintingPermission
here there's a sample that uses it.