VirtualEngine / Lability

Virtual Engine test lab deployment and configuration module
MIT License
282 stars 50 forks source link

File Resource not connecting to network share #405

Open dkettman opened 2 years ago

dkettman commented 2 years ago

Apologies if there is a better place for this, please let me know if there is a better place.

I am looking to use Lability to setup a bare bones lab for incoming employees so they don't have to transfer around large ISO images to their company laptops or worry with missing a step during setup. I have a Domain controller that gets stood up and it works great for that. My next step is getting a SQL server to install. My intended method of install was going to be copy the SQL install files to the VM using a File resource then install using the SQLServer resource.

The issue I'm running into is the File copy from the VM host (which is accessible and verified) because of group policy limitation of getting files as a guest from a file share. If I go in and disable the right GPO (Lanman Server -> Access shares as guest) then it works fine. I have tried adding in a credential field to the File resource, but it seems to ignore it. My File resource is setup as (from the MOF on the SQL host):

instance of MSFT_FileDirectoryConfiguration as $MSFT_FileDirectoryConfiguration1ref
{
ResourceID = "[File]SQLInstallerCopy";
 Type = "Directory";
 Ensure = "Present";
 DestinationPath = "C:\\SQLInstaller";
 ModuleName = "PSDesiredStateConfiguration";
 SourceInfo = "C:\\Users\\Administrator\\source\\repos\\DSC-Lability\\Basic-Lab.ps1::215::9::File";
 Recurse = True;
 SourcePath = "\\\\x.x.x.x\\ISOs\\SQL_2019_standard";
 Credential = $MSFT_Credential1ref;
 PsDscRunAsCredential = $MSFT_Credential1ref;

ModuleVersion = "1.0";

 ConfigurationName = "Delinea_Lab";

};

According to the documentation, this should work. The errors I get are:

PS C:\BootStrap> Start-DscConfiguration -Path C:\Bootstrap -Wait -Force
You can't access this shared folder because your organization's security policies block unauthenticated guest access. These policies
help protect your PC from unsafe or malicious devices on the network. An error occurs when accessing the network share with the
specified credential. Please make sure the credential is correct and the network share is accessible. Note that Credential should
not be specified with the local path. The related file/directory is: \\x.x.x.x\ISOs\SQL_2019_standard.
    + CategoryInfo          : NotSpecified: (:) [], CimException
    + FullyQualifiedErrorId : Windows System Error 1272
    + PSComputerName        : localhost

The SendConfigurationApply function did not succeed.
    + CategoryInfo          : NotSpecified: (root/Microsoft/...gurationManager:String) [], CimException
    + FullyQualifiedErrorId : MI RESULT 1
    + PSComputerName        : localhost

PS C:\BootStrap>

Any help is appreciated.

dkettman commented 2 years ago

Adjusted the title to be accurate instead of whatever it was I decided to type previously :)

iainbrighton commented 1 year ago

Sorry - only just seen this as I'm updating the module. Have you looked at using custom resources (files you can copy to VMs disk)?