As i said in previous post...i checked the return code and it said....access denied..so i know the problem now...since local system is not authenticated to query the domain, the api will fail... According to what you are saying, i need to add an (fake) account to the network and then run the service under that fake account to query the domain....this really doesnt look that great idea because then what i means 1) i am adding a non existent user in the network 2) all machines on the domain where my service is running will need to have that account in local machines (which can be a big risk) So is there some other way of doing it?? kunal
ku19832001
Posts
-
Enumerating user of a domain from a service -
Enumerating user of a domain from a serviceI didnt get it...i thought local system account is the most powerful account with all the rights.....I guess only problem is that only authenticated users are allowed to query the domain but in this local system is not a authenticated user.....Is there some other way of enumeration??
-
Enumerating user of a domain from a serviceHi all, I want to enumerate all the users in the domain from my service. I tried using NetUserEnum and NetQueryDisplayInformation functions but it fails with access denied. When i run the functions from the console application, it works fine but from my service (which runs under local system account) it fails......How do i get around this???.....Is there some other way of enumerating users of a domain from the service??? kunal
-
Creating GUI in .lib file and invoking it from some other applicationHi all, I want to add gui(MFC based) into a lib code.....so for that i followed the following steps 1) Created a new windows based console application with option static lib file selected n by allowing MFC support to the application 2) from the project add....i selected add resource n then created a CDialog based gui into it Upto then everything is fine.....now here something i dont understand 1) wat r the .h and .cpp files related to gui do i need to include n wat code to write in (MFC generates all the code itself in a MFC based application so i m not sure wat to include or wat not to include) 2)I am able to link to lib in my program (proc) without error.....Now how do i invoke the gui in lib from my proc I am taking commandline arguement from the user.....if user says enable gui as arguement....then gui shud pop up or else it shud not pop up How do i achieve it..... Kunal
-
windows service account queryHi all, I have developed a windows service which runs executable files received from some remote machine. Now i dont want to give my service all the rights so i decided to run the service in "NT AUTHORITY\\LocalService" Account... but when i do that i am unable to create any files or destroy any files in the system Now i want mmy service to have capability of creating new files but it shud not be able to destroy any pre-exisiting files....also if possible i want to restrict this file creation to only one particulat folder....meaning for e.g if i have a folder called p2p then any excutable ran frm my service shud be able to create files in that folder only and not in any other folder like program files etc. How do i achieve the above thing thanks kunal
-
searching peers using winsockThanks for the fast reply. Can any one please suggest me how to broadcast a packet in network. What care should i take in sender side and receiver side. A sample code would be of great help thanks kunal s patel
-
searching peers using winsockHello all, i have very specific question regarding winsock "In a network of PC's, i want to find the ip addresses of all the nodes that are running my custom made windows service" How to achieve this. Service is made in C++ using win32 api's and i m using winsock for all networking purposes thanks kunal s patel
-
how to create secure connectionhi can u elobarate on wat u r trying to say...i didnt get it.....wat is sessionid...a char array??? Also i know how to get username n password information...i want to know how to send it over the network in a secure way....copying to a array n sending it in plain text is harmful.....so please suggest me a way to send it over the network in secure way thanks kunal
-
Creating installer utilityHi all i have developed a windows service. rite now i have to manually setup folders, copy the exe of service to it n then manually install and start the service from command prompt. Now i want to automate all this process. I want to make a setup(installer) for that purpose. So that i only need to give that setup program to somebody n when somebody runs that...everything is installed, copied on its own......Please suggest me how do i make the installer code....(something like proffesional software setup programes).......also in which language it wud be easy to do it........my service is in C++ thanks kunal s patel
-
how to create secure connectionHi all i have a client/server application(infact server is a service and client is a MFC gui) now i have a situation where i need to transfer username and password over the network to the server from the gui.........but sending it in plain text is harmful....so my question is how do i start a secure connection to the server n send the information to it n then close the secure connection thanks kunal
-
Terminating Process Error "Access Denied"Considering wat u said i changed the PROCESS_ALL_ACCESS to PROCESS_TERMINATE and tried it but again it failed so now i guess only option left is setting SeDebugPrivilege....now i really dont have a clue how to do it....please suggest me a way out of it
-
Terminating Process Error "Access Denied"Hi all i have a code where i am starting the process from a windows service that i created. Now i want to terminate that process using some other application(MFC stand alone) application. But when ever i try to do that,it gives error 5 which documentation says is "Error Access Denied"......here r the codes that i m using for creating and stopping the process 1)Creating a process success = ::CreateProcess(temp,cmdstr,0,0,FALSE,CREATE_NEW_CONSOLE,0,0,&startupinfo,&procinfo); where temp and cmdstr are application path and command line argument that i pass 2) terminating process HANDLE hn = ::OpenProcess(PROCESS_ALL_ACCESS,false,id); if(hn != NULL) { ::TerminateProcess(hn,0); } now here OpenProcess API fails and gives error........id is the process id of the process i started using a service......please suggest me a way out of this. thanks kunal s patel
-
implementing file browsing facility using MFCHello All i want to implement the file browsing facility as in windows when some one presses "open". My application also has the same requirement where if somebody presses a browse button, the window box opens n the user can browse through various files n drives to select the desired file. Please suggest me a way of implementing this. Is there a api for making this facility??. thanks kunal s patel
-
problem with trnasferring a exe file using socketi used the CreateFile API. In that what flags shud i set. thanks kunal
-
problem with trnasferring a exe file using socketHello all I am transferring an exe file over a socket to some remote pc. Now the problem is when i run this exe on remote pc, it doesnt work properly. I checked few things like my transfer code which works well (i checked with different file types like .cpp,.txt file and also the size on both side is same). Also i did the file comparision of both the files using DOS command fc.(i sent the file on same pc over socket n did it) and there is no difference in both files. When i run the received file,it gives me a error as "C:\DOCUME~1\....TEMP\. A temporary file needed for initialization could not be written to. Make sure that the directory path exists,and the disk space is available. Choose 'close' to terminate the application" I sm unable to get the error as i m the administrator of the pc and the disk is also not full. Please suggest me a way out of it. thanks kunal s patel