سلام:
ممنونم اميد جان اطلاعات شما خيلي بهتر بود
الان 2تا لينك پيدا كردم:
http://www.pscode.com/vb/scripts/ShowCode.asp?txtCodeId=1089&lngWId=10
و این هم راهی برایه گرفتن Domain:
ممنونم اميد جان اطلاعات شما خيلي بهتر بود
الان 2تا لينك پيدا كردم:
http://www.pscode.com/vb/scripts/ShowCode.asp?txtCodeId=1089&lngWId=10
و این هم راهی برایه گرفتن Domain:
کد:
public Function GetDomainAccountNames( _
ByVal sDomainName As String) _
As System.Collections.Hashtable
' Parameters: sDomainName - Domain to check
' Returns: Hashtable containing all properties and
' values
Dim MyQuery As Management.ManagementObjectSearcher = _
New Management.ManagementObjectSearcher( _
"SELECT * FROM Win32_Account WHERE Domain='" & _
sDomainName & "'")
Dim MyQueryResults As Management.ManagementObjectCollection = _
MyQuery.Get()
Dim MyObject As Management.ManagementObject
Dim returnTable As New Hashtable()
Dim intcounter As Integer = 0
For Each MyObject In MyQueryResults
returnTable.Add(intcounter, MyObject.Item("Name"))
intcounter = intcounter + 1
Next
Return returnTable
End Function