Question Directory.Exists and UNC headache!

unibroue

New member
Joined
Aug 19, 2009
Messages
4
Programming Experience
1-3
Hi guys,

first i want to thanks everyone on this forum who makes it possible for us to learn VB.NET and obtain help.

I'm building an application which require to use Directory.Exists on a network share UNC path. I know how to use that function, and how to implement it in my code, it's working perfecty locally.

Here my setup:

- VS2003
- .NET 1.1
- It's an Outlook Add-In

Here the code :

VB.NET:
Dim realpath as string = "\\myserver\folder$\subfolder"
Impersonation.ImpersonateUser("admin", "DOMAIN", "adminpass")
                Dim isDirExist As Boolean = Directory.Exists(realpath)
                If isDirExist = False Then
                    Directory.CreateDirectory(realpath)
                End If
                Impersonation.undoImpersonation()

If i build this code, and register it in Outlook with my personnal account (admin), it's working fine, i receive TRUE.

If i build this same code, an register it in the Outlook of a normal employee (user only), it's always returning FALSE, no matter if the directory exist or not.

The share is set to EVERYONE allow, and i tried giving EVERYONE access to the ACL, and it's the same result.

The fact that i work using my admin account, make me believe it's a security issue, but why the impersonation doesn't fix it? I mean, i tested the impersonation, and the code is working good, the code ran with the specified username!

This problem seems to occur only on Windows Server 2008 which is our new terminal services server.

Now i don't know where to look, and what to look at ... if you guys could give me some advices i would appreciate.

Please that i have search the Internet A LOT for an answer to my question, and all answers are for ASP.NET saying that you need to use impersonate...

Thanks for your time!
 
I found my answer ...

i need to remove the Impersonation for the Windows 2008 server, so i need to run a different setup only for that server cause the impersonation was working ok, but was causing problem with the unc and directory.exists!

Now i need to find why the sqlclient of 1.1 doesn't work under 2008 server ...

damn ...

thanks
 
Back
Top