VB.Net-具有用户凭据的本地WMI连接 [英] VB.Net - Local WMI Connection with user credentials

查看:233
本文介绍了VB.Net-具有用户凭据的本地WMI连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在VB.Net中,我试图使用不同的凭据连接到本地计算机上的WMI(用户将没有管理员权限),并且出现此异常:

In VB.Net, I'm trying to connect to WMI on my local computer with different credentials (the user won't have admin rights) and I get this exception :

«用户凭证不能用于本地连接»

« User credentials cannot be used for local connections »

这是代码:

    Dim path As ManagementPath = Nothing
    Dim options As ConnectionOptions = Nothing
    Dim scope As ManagementScope = Nothing

    path = New ManagementPath("\\" & vServerName & "\root\CIMV2")

    options = New ConnectionOptions
    options.Username = vUsername
    options.Password = vPassword

    Scope = New ManagementScope(path, options)

    Scope.Connect()

推荐答案

我知道这个问题很旧,但是我尝试了上述步骤,但没有成功.我发现可以使用的是:

I know this question is old, but I tried the above steps and it didn't work. What I found to work was this:

https://web.archive.org/web/20150213044821/http://www.manageengine.com/network-monitoring/help/troubleshoot_opmanager/troubleshoot_wmi.html

80041064-用户凭据不能用于本地连接

80041064 - User credentials cannot be used for local connections

原因

当您指定用于监视运行OpManager的计算机的用户名和密码时,会遇到此错误.

This error is encountered when you specify the Username and password for monitoring the machine where OpManager is running.

解决方案

请勿为本地主机指定用户名和密码.要解决此问题,请从设备快照页面的密码"链接中删除已配置的用户名和密码.

Do not specify Username and password for the localhost. To resolve the issue, remove the configured user name and password from "Passwords" link in the device snapshot page.

这篇关于VB.Net-具有用户凭据的本地WMI连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆