Creating Virtual Directory on shared drive

Creating Virtual Directory on shared drive

am 15.01.2008 16:31:01 von vasimo

Hi,
HELP!!!!!!!!!!!!!

XP Desktop with IIS 5 doing web class development. Virtual directories are
required for .Net apps.
Our root folder for the web site is located on a drive share.
I am trying to create virtual directories using VB script on all developer
machines.
The following creates the virtual and applies the following parms but tags
it with an error of 'Access Denied'.
If I move the virtuals to the C drive it works with no issues.
If I create it maually on the share, it prompts for the UID & PW and then
creates it without the 'Access Denied' error.
How do I give the create command the UID & PW so the script will do what the
manual process allows?
Thanks Vic

Const WebClassDirPath =
"\\ny17nt103\shared\itshare\ADIApplications\Develop\APPS\Dev elop\ADIADONIS\"
Const wDirName = "ZYZ123"

Set IIsWebVDirRootObj = GetObject("IIS://localhost/W3SVC/1/Root")
Set IIsWebVDirObj = IIsWebVDirRootObj.Create("IIsWebVirtualDir",
wDirName)
If Err.Number = 0 Then

IIsWebVDirObj.UNCUserName = strUser 'contains valid UID
IIsWebVDirObj.UNCPassword = strPassword 'contains valid PW
If (Err > 0) Then
MsgBox "UNCPassword error - " & Err & " " & Error.Description
Wscript.quit (0)
End If

IIsWebVDirObj.Put "Path", WebClassDirPath & wDirName
IIsWebVDirObj.Put "AccessRead", True
IIsWebVDirObj.Put "AccessScript", True
IIsWebVDirObj.Put "AppIsolated",0 '1=High, 2=Medium,
0=Low
IIsWebVDirObj.Put "DontLog", False 'False means log
visits

IIsWebVDirObj.Put "AppFriendlyName", wDirName
IIsWebVDirObj.SetInfo
End If

Re: Creating Virtual Directory on shared drive

am 16.01.2008 08:35:02 von David Wang

http://www.microsoft.com/technet/prodtechnol/windowsserver20 03/technologies/=
webapp/iis/remstorg.mspx

Are you sure your code mirrors ALL the proper value settings? I don't
see AuthFlags .


//David
http://w3-4u.blogspot.com
http://blogs.msdn.com/David.Wang
//



On Jan 15, 7:31=A0am, vasimo wrote:
> Hi,
> HELP!!!!!!!!!!!!!
>
> XP Desktop with IIS 5 doing web class development. Virtual directories are=

> required for .Net apps.
> Our root folder for the web site is located on a drive share.
> I am trying to create virtual directories using VB script on all developer=

> machines.
> The following creates the virtual and applies the following parms but tags=

> it with an error of 'Access Denied'.
> If I move the virtuals to the C drive it works with no issues.
> If I create it maually on the share, it prompts for the UID & PW and then
> creates it without the 'Access Denied' error.
> How do I give the create command the UID & PW so the script will do what t=
he
> manual process allows?
> Thanks Vic =A0
>
> Const WebClassDirPath =3D
> "\\ny17nt103\shared\itshare\ADIApplications\Develop\APPS\Dev elop\ADIADONIS=
\=AD"
> Const wDirName =3D "ZYZ123"
>
> =A0 =A0 Set IIsWebVDirRootObj =3D GetObject("IIS://localhost/W3SVC/1/Root"=
)
> =A0 =A0 Set IIsWebVDirObj =3D IIsWebVDirRootObj.Create("IIsWebVirtualDir",=

> wDirName)
> =A0 =A0 If Err.Number =3D 0 Then
>
> =A0 =A0 =A0 =A0 =A0IIsWebVDirObj.UNCUserName =3D strUser =A0 =A0 =A0 =A0 '=
contains valid UID
> =A0 =A0 =A0 =A0 =A0IIsWebVDirObj.UNCPassword =3D strPassword =A0 =A0 'cont=
ains valid PW
> =A0 =A0 =A0 =A0 =A0If (Err > 0) Then
> =A0 =A0 =A0 =A0 =A0 =A0 =A0MsgBox "UNCPassword error - " & Err & " =A0 " &=
Error.Description
> =A0 =A0 =A0 =A0 =A0 =A0 =A0Wscript.quit (0)
> =A0 =A0 =A0 =A0 =A0End If
>
> =A0 =A0 =A0 =A0 IIsWebVDirObj.Put "Path", WebClassDirPath & wDirName =A0
> =A0 =A0 =A0 =A0 IIsWebVDirObj.Put "AccessRead", True
> =A0 =A0 =A0 =A0 IIsWebVDirObj.Put "AccessScript", True
> =A0 =A0 =A0 =A0 IIsWebVDirObj.Put "AppIsolated",0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0'1=3DHigh, 2=3DMedium,
> 0=3DLow
> =A0 =A0 =A0 =A0 IIsWebVDirObj.Put "DontLog", False =A0 =A0 =A0 =A0 =A0 =A0=
=A0 'False means log
> visits
>
> =A0 =A0 =A0 =A0 IIsWebVDirObj.Put "AppFriendlyName", wDirName
> =A0 =A0 =A0 =A0 IIsWebVDirObj.SetInfo
> =A0 =A0 End If