• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 511
  • Last Modified:

Copy file from NT to iSeries via VB.Net

I am using VB.Net to attempt to write files to an iSeries.  I have tried impersonation in the code but I still get Access denied when trying to impersonate the iSeries user.  The server I am running the code from is a Windows NT Box.  I can run my code successfully all day using impersonation when I am in the same domain, this problem happens when I cross domains.  

I am assuming it is some type of trust issue between the domains or it has something to do with Windows and iSeries talking to each other.  I am at a loss here myself.  I don't know enough about the iSeries to figure this out.

I can create and delete files on the iSeries from the Windows NT box when I map a drive to the iSeries from that box using the user I am impersonating with, but I just can't do it in code so far.
0
ratman925
Asked:
ratman925
  • 6
  • 5
5 Solutions
 
giltjrCommented:
Assuming when you say "domains" you mean Windows domains and not IP domains.

When you are "crossing" domains, are you in the same IP subnet?  


Could be that security on the iSeries is setup to allow specific users based on which IP address(es) they are coming from.

It is also highly possible that the working domain has a trusted security setup with the iSeries using LDAP, AD, kerberos, or something like that.  You need to check with the security admins on the iSeries.
0
 
ratman925Author Commented:
Yes, I mean Windows domains.

I don't know if the domains are in the same IP subnet, I will have to check.

Curious why I can copy files from that machine using Explorer with a mapped drive, but I can't when using impersonation through vb.net code.

I will have to get with the Amins on the iSeries for more information.
0
 
giltjrCommented:
When you are attempting to write the files using VB.net are you mapping a drive?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
ratman925Author Commented:
I have tried mapping a drive and doing it that way but it didn't work.  I am now trying to use impersonation.
0
 
giltjrCommented:
Maybe I am misunderstanding something.  To me "impersonation" means that you are using a user-id/password, or some other form of credentials, to say you are somebody else.  Is that what you mean?  If that is what you mean, then what function/method/protocol are you using to attempt to copy the file?
0
 
ratman925Author Commented:
Yes impersonation is using another userid/password.  In .Net when I get ready to copy a file to the iSeries I attempt to impersonate a user on the iSeries, the impersonation fails.  I am working with my Network team right now.  My windows network guy says that it is an iSeries security issue at this point.
0
 
giltjrCommented:
O.K.  My guess is that either there is a trust of some sort setup between the working domain and the iSeries, or there is a "firewall type device" that is preventing the type of copy that you are trying to do from the other domain.

When you are logged on from the other domain, I am assuming you are on another computer and most likely on another IP subnet.  You stated that you can map a drive to the iSeries and copy that way.   That is most likely using NetBIOS/CIFS.  How are you attempting to copy within your program?   It is possible that if there is a "firewall" between the domain and iSeries that what ever protocol you are attempting to use in your program is blocked, but NetBIOS/CIFS is allowed.
0
 
ratman925Author Commented:
Well I have figured out that this problem has nothing to do with the iSeries.  I can take my same code and run it through a .Net form and it works fine, however when I run the application as a service it won't copy the file.  I have tried shelling to DOS, impersonation and everything I can think of.  Even running the service as myself (Administrator).  Should I post this in another section now?
0
 
ratman925Author Commented:
ok, I solved my problem.  The only way I could ever get a file written from an NT box to the iSeries running my application in .Net was to use Windows API calls (mpr.dll) and mapping a drive from within my running application.  This allowed me to use the mapped drive to copy the file(s).  I am still confused as to why I couldn't get this to work when I was running the service under an Adminstrator account.
0
 
giltjrCommented:
O.K.  I asked twice and you never answered.  Exactly how were you attempting to copy without mapping the share as a drive?
0
 
ratman925Author Commented:
Using UNC.  I tried everything I could think of.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now