vb运行报错rpc服务器不可用,.Invoke(“SetPassword”,...)导致的“RPC服务器不可用”错误...

Dim rootEntry As New DirectoryEntry

With rootEntry

.Path = "LDAP://" & strServer & "/" & strLDAP

.AuthenticationType = AuthenticationTypes.Secure

.Username = strServerUsername

.Password = strServerPassword

End With

Dim newUser As DirectoryEntry = rootEntry.Children.Add("CN=" & strCN, "user")

With newUser

.CommitChanges()

.Properties("userPrincipalName").Value = TextPN.Text

.Properties("sAMAccountName").Value = TextAlias.Text

.Properties("givenname").Value = TextGivenname.Text

.Properties("sn").Value = TextSurname.Text

……

.CommitChanges()

.Invoke("setPassword", New Object() {strDefaultPassword})

.CommitChanges()

.Properties("userAccountControl").Value = &H0001

.CommitChanges()

End With 我们的活动目录创建新用户

此代码在过去运行良好。 现在我们已经将我们的网络服务器迁移到Windows Server 2008 R2和IIS 7.5,并且代码突然不再工作了。 (.net framework为2.0,无法更改) 用户仍在我们的活动目录中创建,但该帐户被自动禁用,并且未设置密码。

调查这个问题显示,一个例外是在线抛出

.Invoke("setPassword", New Object() {strDefaultPassword})

异常

The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)

其用于连接到AD的用户帐户仍然是相同的并具有域管理权利。 由于代码没有任何改变,我认为必须有另一个原因,为什么这不工作了?防火墙设置,IIS配置,..?

任何想法??

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值