Solved

Server Authentication with VBA

Posted on 2011-03-18
7
821 Views
Last Modified: 2012-05-11
Can vba be used to authenticate a machine with a server?
This script will be run after login to an account in windows xp home (startup folder) to
authenticate the machine to a windows server 2003 server. (in a workgroup. not a domain)

this is an example that do the same thing with a batch file.
net use \\192.168.10.200\DataFile /user:myusername mypassword
Is VBA able to do the same thing?

1

I don't need to add a mapped network drive. So I can't use scripts like following
Set oNet = CreateObject("WScript.Network")
oNet.MapNetworkDrive "H:", "\\192.168.10.200\DataFile", True, "MyUsername","MyPassword"


2

I don't want to run a batch file from VBA to authenticate the machine (like the following script).
Dim oShell
Set oShell = WScript.CreateObject ("WScript.Shell")
oShell.run "net use \\192.168.100.220\Public /user:myusername mypassword" , 0, False
Set oShell = Nothing


I need to know if VBA is able to authenticate a PC without adding a mapped network drive.
Any kind of help is much appreciated.


0
Comment
Question by:MnInShdw
7 Comments
 
LVL 21
Comment Utility
AFAIK you will have to do something that requires you to log in.

There might be some API call that will perform an operation that will cause the authentication process to be required where you can pass the user name and password.  
0
 
LVL 1

Author Comment

by:MnInShdw
Comment Utility
Sorry, but I don't understand what you mean. some sample codes or a little bit more explanation is much appreciated.
0
 
LVL 1

Accepted Solution

by:
crystal_Tech earned 500 total points
Comment Utility
User Name and password must be set on the server 2003
Using INET component
In my case its working perfectly

 Dim ThisUrl As String
    ThisUrl = "192.168.10.200"
   
    Inet1.RemoteHost = ThisUrl
    Inet1.AccessType = icDirect
    Inet1.Protocol = icFTP
    Inet1.RemotePort = 21
   
    Inet1.URL = ThisUrl
    Inet1.UserName = "************"
    Inet1.Password = "*************"

0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 1

Author Comment

by:MnInShdw
Comment Utility
I'm receiving an error on line 4.
Unrecognized Object 'Inet1'
error code: 800A01A8


thank you
0
 
LVL 1

Expert Comment

by:crystal_Tech
Comment Utility

i dont know about vba but in vb6 inet component you can get from
Projects > Components > Microsoft Internet Transfer Control 6.0
and you can get it

Place this component to your vb form
0
 
LVL 53

Expert Comment

by:Dhaest
Comment Utility
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now