netapi32

Where does NetServerEnum get its list of machines from?

Where does NetServerEnum() get its list of machines from? Does it use the computer browser service or will it use AD as a preference if AD is available? Links: NetServerEnum on MSDN NetServerEnum on PInvoke Decription of the Computer Browser Service ...

Trouble accessing functions of NetAPI32 wrapped in WCF that create users..

Hi stackers... I have created a project which is basically described as a consumable service to create or edit users on a remote computer. The idea is to connect to a server and add a user. The structure of the project is as follows: WCF Service: to expose functions to create/edit/select users Utility assembly: Netapi32 COM functions ...

Can anyone help me with the Windows API NetApi32?

I am trying to get a list of shares on a specific machine. So I decided to use the Windows API NetApi32.dll. Here is my code snippet: Dim svr As String = Environment.MachineName Dim level As Integer = 2 Dim sharesRead As Integer, totalEntries As Integer, nRet As Integer, hResume As Integer = 0 Dim pBuffer As IntPtr = IntPtr.Zero nRet =...

Need a way to change a remote user password - NetUserChangePassword fails with 2245

I am trying to call NetUserChangePassword to change the passwords on a remote computer. I am able to change the password when I log-in to the machine, but I can't do it via code. The return value is 2245 which equates to the Password Being too short. I read this link: http://support.microsoft.com/default.aspx?scid=kb;en-us;131226 but ...

Getting a key (secret) for a HMAC-MD5 hash

I am looking at the NetUserSetInfo method. It can take a USER_INFO_21 structure that allows me to pass in a "one-way encrypted LAN Manager 2.x-compatible password". I think this means a HMAC-MD5 hash. The class System.Security.Cryptography.HMACMD5 can create one of these hashes, but it needs a key (or shared secret) for that class to ...

Shouldn't NetUserModalsGet() tell me what domain a machine is part of, and where the PDC is?

This question is third on a series. Thanks to Gonzalo and Mattias S for helping me work out the kinks of calling NetUserModalsGet() from C#. This question, unlike the others, isn't really C# specific -- I think. Here's the working code with which I can call NetUserModalsGet() from C# on a remote machine. It works well, but according to ...

JNA - DsGetDcNameA

Hi, I am new to JNA, I want to convert DsGetDcName method to JNA. DWORD DsGetDcName( __in LPCTSTR ComputerName, __in LPCTSTR DomainName, __in GUID *DomainGuid, __in LPCTSTR SiteName, __in ULONG Flags, __out PDOMAIN_CONTROLLER_INFO *DomainControllerInfo ); I have converted the above function to JNA I replaced ab...

code to identify the number

Hi All, I got one problem while doing one TAPI application based project in C#. I'm using ITAPI3.dll My problem is.. i'm not getting incoming call information. To get the incoming call information, i'm using the get_callinfo function, but it is showing empty message. ...

Set DFS Link Permission with C#

Hi I have to set permissions on a DFS Link with C#. (For adding a DFS Link I used the method NetDfsAdd from the NetApi32.dll. ) After a while searching I found the MSDN Article[0] about NetDfsSetInfo and it describes that I can use this function to set the permissions. But I am a bit confused about DFS_INFO_107 Structure[1] and SECURIT...