iis - 从工作组 IIS 安装向 AD 进行身份验证
问题描述
我正在使用经典的 ASP(我知道我应该继续使用 ASP.NET)和工作组 IIS 安装。我可以让它对 AD 进行身份验证吗?因此,到目前为止,它只是无法连接到 AD。
它在我的已加入域的桌面上运行,没有任何麻烦,但相同的代码在工作组机器上不起作用。
Session( "signon_domain" ) = UCase( strSignOnDomain )
Session( "signon_userid" ) = LCase( strSignOnUserID )
' Set the AD path to connect to
strADsPath = "WinNT://" & strSignOnDomain
' Bind to the AD path
Set objADsPath = GetObject( strADsPath )
' Get the namespace
strADsNamespace = "WinNT:"
' Bind to the namespace
Set objADsNamespace = GetObject( strADsNamespace )
' Turn on error handling
On Error Resume Next
' Connect to AD with the provided credentials
Set objADsAuthenticate = objADsNamespace.OpenDSObject( strADsPath, strSignOnDomain & "\" & strSignOnUserID, strSignOnPassword, 0 )
' Check for any errors
If Err.Number <> 0 Then
' Specify the error to display
strMessage = "User ID or password or domain incorrect."
Session( "signon" ) = ""
Else
Session( "signon" ) = "successful"
End If
' Turn off error handling
On Error Goto 0
' Clear variables
Set objADsAuthenticate = Nothing
Set objADsNamespace = Nothing
Set objADsPath = Nothing
strADsNamespace = Empty
strADsPath = Empty
期待来自 AD 的响应,但它根本没有连接到 AD。
解决方案
推荐阅读
- c++ - 如何在for循环中保存变量?
- reactjs - React 返回中的三元运算符问题
- android - 如何使用 Hilt 将 Retrofit 注入到 Repository,它被注入到 ViewModel?
- c# - 循环访问 SQL Server 记录
- javascript - 停止事件在按钮单击时发生在 div 上
- html - 我的 WordPress 特色图片未显示在 Facebook 帖子和推文中
- macos - 在基于英特尔的 macbook 上,“无法在 ARM 默认前缀的英特尔处理器上的 Homebrew 中安装”
- c# - Bot Framework AdaptiveDialog:仅当对话框位于堆栈顶部时才触发活动?
- subset - Python xarray:在不同位置使用method ='nearest'处理循环的数据
- c - 尽管已声明,但 C 中未声明的标识符错误