IIS virtual directory with system share

This topic contains 1 reply, has 2 voices, and was last updated by  Don Jones 10 months, 1 week ago.

  • Author
    Posts
  • #59992

    Efff dd
    Participant

    hello
    trying to create a new virtual directory under dsc. I can get the share using windows explorer and from the GUI of IIS.

    here is what I have for the new virtual directory
    @{
    Name = 'archive'
    PhysicalPath = '\\nt2.123.com\Q$\Lesso\Archive'
    Ensure = 'Present'
    }
    the errors :
    Cannot find path 'IIS:\Sites\lesso.123.com\archive' because it does not exist.
    + CategoryInfo : ObjectNotFound: (IIS:\Sites\less...123.com\archive:) [], CimException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetItemPropertyCommand
    + PSComputerName : APP1

    The PowerShell DSC resource 123_cVirtualDirectory threw one or more non-terminating errors while running the Set-TargetResource
    functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel for more details.
    + CategoryInfo : InvalidOperation: (:) [], CimException
    + FullyQualifiedErrorId : NonTerminatingErrorFromProvider
    + PSComputerName : APP1

  • #60010

    Don Jones
    Keymaster

    I'm not certain the WebSite resource is presently geared to accept UNCs. Look at its code (https://github.com/PowerShell/xWebAdministration/blob/dev/DSCResources/MSFT_xWebsite/MSFT_xWebsite.psm1), it's attempting to use the IIS: drive created by the WebAdministration module:

                    Set-ItemProperty -Path "IIS:\Sites\$Name" `
                                     -Name physicalPath `
                                     -Value $PhysicalPath `
                                     -ErrorAction Stop
    
    
    to set the physical path. Try manually running that yourself in a normal PowerShell console, using your correct values, and see what you get.

You must be logged in to reply to this topic.