网络服务器中的Windows用户列表 [英] List of Windows User in a Network Server

查看:175
本文介绍了网络服务器中的Windows用户列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Dim de As New DirectoryEntry()
            Dim lboolUserExists As Boolean = False
            de.Path = "WinNT://" + paramComputerName
            For Each d As DirectoryEntry In de.Children()
                'If d.SchemaClassName = "Computer" Then MsgBox(d.Name)
                If d.SchemaClassName = "User" Then
                    If d.Name = USER_NAME Then
                        lboolUserExists = True
                        Exit For
                    End If
                End If
            Next
            Return lboolUserExists




上面的功能并不总是适用于网络服务器,因此我无法获得Windows用户列表.请给我建议一些解决方案.

Madhu




The above function does not always work for a Network Server and hence I am unable to get a list of Windows users. Please suggest me some solution.

Madhu

推荐答案

它并不总是有效"是什么意思?如果它有时而不是其他时间可行,则问题可能甚至不在您的代码中.
What do you mean by "it doesn''t always work"? If it works sometimes and not other times, the problem may not even be in your code.


这篇关于网络服务器中的Windows用户列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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