FileOperation and UNC-path

33 views
Skip to first unread message

Mauri Kaatrasalo

unread,
Feb 13, 2013, 8:44:52 AM2/13/13
to ensemble-in...@googlegroups.com
Hi!
 
I've got windows account and password to access an UNC-path.
 
Like..
 
Username: mydomain\myuser
Password: mypassword
 
I think Ensemble doesn't support credentials with EnsLib.File.OutboundAdapter.
 
I'm going to make mydomain\myuser as local admin on my Ensemble-server and run Ensemble on this account. Then I think Ensemble can directly use UNC-path.
 
How have You others resolved issue like this?

Best Regards, Mauri

peter cooper

unread,
Feb 13, 2013, 9:06:21 AM2/13/13
to Ensemble-in...@googlegroups.com

Hi Mauri

 

I think it’s not Ensemble

The ensemble instance is running on the server – it is this that has access to UNC’s and I don’t believe that windows will let you change this

What you need to do is give set the username that is running Ensemble at start up the correct access – or change the service account – look in Control Panel ->services

 

Or so I think

 

Peter

--
You received this message because you are subscribed to the Google Groups "InterSystems: Ensemble in Healthcare Community" group.
To post to this group, send email to Ensemble-in...@googlegroups.com
To unsubscribe from this group, send email to Ensemble-in-Healt...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/Ensemble-in-Healthcare?hl=en
---
You received this message because you are subscribed to the Google Groups "InterSystems: Ensemble in Healthcare" group.
To unsubscribe from this group and stop receiving emails from it, send an email to Ensemble-in-Healt...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Mauri Kaatrasalo

unread,
Feb 13, 2013, 9:28:32 AM2/13/13
to ensemble-in...@googlegroups.com
Solved like this, made my own operation..
 
 // connect network path
 If ($E(..Adapter.FilePath,1,2) = "\\") & (..Username '= "") {
  Set tNetUse="net use "_..Adapter.FilePath_" /user:"_..Username_" "_..Password
  Do $ZF(-1,tNetUse)
 }
 // call adapter
 Set tStatus = ..Adapter.PutStream(tFileName, pRequest.Content)
 // release network path
 If ($E(..Adapter.FilePath,1,2) = "\\") & (..Username '= "") {
  Set tNetUse="net use "_..Adapter.FilePath_" /delete"
  Do $ZF(-1,tNetUse)
 }
Seems to work.
 
Mauri
 
 
2013/2/13 Mauri Kaatrasalo <mauri.ka...@iki.fi>

Ted Peck

unread,
Feb 13, 2013, 10:24:32 AM2/13/13
to Ensemble-in...@googlegroups.com, Mauri Kaatrasalo
Nice, thanks!
I assume this worked even without running Ensemble in the mydomain\myuser account?

I did not expect this would work because the "net use" command would only remain in effect within the temporary session during the execution interval of the $ZF(-1) command.  So, this is valuable information.

Ted
--

peter cooper

unread,
Feb 13, 2013, 10:42:55 AM2/13/13
to Ensemble-in...@googlegroups.com

Hi Mauri

 

That’s neat – did not know you could do that

 

Peter

--

Andy Picou

unread,
Feb 13, 2013, 11:31:12 AM2/13/13
to Ensemble-in...@googlegroups.com

I agree. That is neat. And I guess one could retrieve Username and Password from Ens_Config.Credentials. It’s a wonder why Intersystems’ doesn’t make this a standard FileIn/FileOut Adapter. Sure beats having to map a drive via %ZSTART.mac

Matt Simpson

unread,
Feb 13, 2013, 11:53:27 AM2/13/13
to Ensemble-in...@googlegroups.com
Mauri,

 

You've found a solution, but it doesn't allow you to use UNC paths with all of the pre-built file operations.  You may prefer to just use UNC paths with the existing file operations.


The key to using UNC paths is that the service account that is running the ensemble service must be given appropriate permissions on the share you are trying to read/write

 

So, if you run ensemble under mydomain\myuser ensure that this account has read/write access on the file share you are trying to use

 

A simple way to test is to log into your ensemble server as the service account (mydomain\myuser) and try to browse and read/write the same UNC path you want to use in file operation.


This is how I have always done file operations on file shares using UNC paths


-Matt


Ted Peck

unread,
Feb 13, 2013, 1:36:31 PM2/13/13
to Ensemble-in...@googlegroups.com, Andy Picou
I think we will try, now that Mauri has reported it's possible.  I also was under the impression that %ZSTART was the only way to do it.

Normally we try to avoid Windows-only features but this one has high value.

Ted

Marc Lang

unread,
Feb 13, 2013, 4:26:14 PM2/13/13
to InterSystems: Ensemble in Healthcare
I aam lucky (?) that our ensemble servers run under windows, with a domain service account so setting up shares is always pretty easy.
This is really nice though.

On a slightly related note - I notice that SOAP Adapters don't work with NTLM authentication, when connecting to things like SQL Reporting Services webservice, Sharepoint etc which run under IIS Windows Authentication.

Reply all
Reply to author
Forward
0 new messages