Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File Resource not connecting to network share #405

Open
dkettman opened this issue Jul 25, 2022 · 2 comments
Open

File Resource not connecting to network share #405

dkettman opened this issue Jul 25, 2022 · 2 comments

Comments

@dkettman
Copy link

dkettman commented Jul 25, 2022

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 dkettman changed the title Configuration not completing after reboot File Resource not connecting to network share Jul 26, 2022
@dkettman
Copy link
Author

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

@iainbrighton
Copy link
Contributor

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)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants