How do you connect to a remote PC in MS Access?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • anoble1
    New Member
    • Jul 2008
    • 246

    How do you connect to a remote PC in MS Access?

    Hey,

    I was wondering on how you can connect to a remote PC on your network using MS Access? I was wanting something "Similar" to the DOS command "Shutdown -i" what I mean by that is: The shutdown -i command brings up a box and lets you type in the PC's name and lets you do a few functions. I want to be able to use the "Grabbing a PC's info" function off that, without remoting into their machine.

    WHY?
    I want to be able to grab PC and deploy RegFiles to them once I have the PC that I want to configure, from a Help Desk stand point. Is this possible? I have read a few things about WinSock, maybe it has to do with this? I Don't know.

    See screenshot. I just wanted to grab a PC on the network and make it to where it will connect to that PC so that I could run a few commands without the user knowing. See screenshot.
    [imgnothumb]http://bytes.com/attachments/attachment/6862d1359154958/2013-01-25-17_00_56-microsoft-access-reg-database-_-database-access-2007-.png[/imgnothumb]
    Attached Files
    Last edited by NeoPa; Jan 26 '13, 09:08 PM. Reason: Made pic viewable.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    You can use WMI to manage remote machines, including the registry. Assuming you have remote admin access of course. But if you can remotely shut down a computer, you can probably use WMI to remotely manage the computer as well. You can find a WMI primer here: http://bytes.com/topic/access/insigh...n-wmi-tutorial

    Comment

    • anoble1
      New Member
      • Jul 2008
      • 246

      #3
      Very interesting. Do you have a sample db with a form and everything?

      Comment

      • Rabbit
        Recognized Expert MVP
        • Jan 2007
        • 12517

        #4
        Sorry, I do not. But it would be simple to create one from the tutorial. There is nothing but a blank form and code.

        Comment

        • anoble1
          New Member
          • Jul 2008
          • 246

          #5
          Is there code in there that I am missing that lets you search PC's on the network. Ex. User input a PC name and have it search or it on the network?

          Comment

          • Rabbit
            Recognized Expert MVP
            • Jan 2007
            • 12517

            #6
            The tutorial says that you can replace the period with the IP address of a remote machine.

            Comment

            • zmbd
              Recognized Expert Moderator Expert
              • Mar 2012
              • 5501

              #7
              Caution:
              This kind of code can be malicious in nature and not something that would normally be shared with just anybody.

              Also as Rabbit noted, you may need certain security level settings. For example, I used to call the windows os command to "shutdown - l" and IT security has disabled that both at the local and remote levels unless the user is in the admins group and the program is running from an elevated account. Win7 and the newer servers closed alot of those little security loopholes.

              Comment

              • anoble1
                New Member
                • Jul 2008
                • 246

                #8
                We have not disabled it for our Admin group. I was not clear in my first question. I have no way to connect to a PC. If I did then I could use the WMI code you provided which is great! Where is code to connect to a PC "similar" to the format of the shutdown -I command.

                Comment

                • NeoPa
                  Recognized Expert Moderator MVP
                  • Oct 2006
                  • 32633

                  #9
                  Originally posted by ANoble1
                  ANoble1:
                  Is there code in there that I am missing that lets you search PC's on the network.
                  You seem to be asking about how to use the services of the Computer Browser Service (What Is Computer Browser Service?; Description of the Microsoft Computer Browser Service).

                  I suggest you need a clearer understanding of what you expect to be working with before you're in a position to ask for technical help on it.

                  There may be something in the WMI about the API for the Browser Service. Googling {Windows Browser Service API} didn't throw up anything too helpful :-( I expect this is where you should be looking though.

                  Comment

                  • Rabbit
                    Recognized Expert MVP
                    • Jan 2007
                    • 12517

                    #10
                    I thought you knew the PC's name? You can just ping it to get its IP address.

                    Comment

                    • NeoPa
                      Recognized Expert Moderator MVP
                      • Oct 2006
                      • 32633

                      #11
                      If you want that info programatically , then you probably want the getaddrinfo function (Windows). Let us know if you need a hand converting this into something that can be used more easily in VBA.

                      If this is what you're after I find the way the question was asked baffling. If it isn't, I still do.

                      Comment

                      • anoble1
                        New Member
                        • Jul 2008
                        • 246

                        #12
                        I think the getaddrinfo may be what I am looking for when trying to search the network for PC's to connect via PC name or IP Address in VB. I see the function.

                        I didn't think there was that much code just to search the network and find computers. Do you have some simpler code?

                        I know the PC's name and IP Address, but I just have no code in VB to connect to the machine.

                        Comment

                        • NeoPa
                          Recognized Expert Moderator MVP
                          • Oct 2006
                          • 32633

                          #13
                          I'm struggling to understand what this thread is really about asking for. I'm sure you appreciate by now that only one question is allowed per thread. I'm really not sure which that is though, at this point (otherwise I'd tidy it up myself). Please decide what it is you are actually asking about and stick to that in here. Feel free to post a separate thread for any other area you'd like to branch into.
                          Originally posted by ANoble1
                          ANoble1:
                          I know the PC's name and IP Address, but I just have no code in VB to connect to the machine.
                          Connecting to a machine has so many possible meanings that it's hard to know what you are asking about. From the rest of the thread I would guess the context points towards the sort of programmed interaction that is provided by the WMI interface (Mentioned in post #2). If you have the name and the IP address then that would seem to be the next step. That's very little to do with browsing of course.

                          You should understand that, although this is a perfectly valid question to post in the Access forum, the area of expertise required would not fall within the typical experience of most Access experts. I guess it's also quite difficult to express easily from your perspective too. Keeping it to one topic will make that easier for you as well as anyone trying to follow the thread though.

                          Comment

                          • zmbd
                            Recognized Expert Moderator Expert
                            • Mar 2012
                            • 5501

                            #14
                            My problem with this entire thread is the WHY?
                            Why would you need to do this from within a VBA context?
                            Why would you need to be messing with the registry in a manner that requires a shutdown?
                            Why would you need to do this WITHOUT user INTERACTION?
                            It appears that there is even a need to bypass the normal windows security?

                            I normally want to think the best about requests here; however, all of these put together lead me to want to close and delete this thread as potentially a request for malicious code.

                            There are tools within the VBA language that allows one to add and remove run-time registry keys for the programmed application. These should be normally enough for most programmers. I would suggest looking into these tools.

                            Comment

                            • NeoPa
                              Recognized Expert Moderator MVP
                              • Oct 2006
                              • 32633

                              #15
                              I don't believe there are any worries on that score Z. ANoble1 is a frequent user and their past history doesn't indicate any such worries. Check the OP for an attempt to explain why they require such code. I'm afraid it isn't crystal, but it does give an indication of their aims.

                              Comment

                              Working...