0

I am currently using a File resource with a credential which has been obtained through Get-Credential. I have a number of machines which are not on a domain but all on the same subnet. One of these machines has a share created on it, the file resource has this Share as its source specified as \10.10.10.1\MyShare. I have been messing around with the share/file permissions and local policy settings to try and get it accessible without credentials and I have found that SYSTEM users which are not on a domain cannot access a share which is also not on a domain. So I am now trying to use the credential option to access the share but I am getting this message:

A specified logon session does not exist. It may already have been terminated. 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.

Example Configuration:

$ConfigurationData = 
@{
    AllNodes =
    @(
         @{ NodeName = "*"; 
            Source = "\\10.10.10.1\MyShare"; 
            DestinationPath = "C:/DeployDirectory"; 
            Credential = Get-Credential;
            PSDscAllowPlainTextPassword = $true }
         @{ NodeName = "10.10.10.1" }
         @{ NodeName = "10.10.10.2" }
     )
}

Configuration TestConfig
{
    Node $AllNodes.NodeName
    {
        for ($i=1; $i -le 100; $i++)
        {
            File "Test$i"
            {
                Ensure = "Present"
                Type = "File"
                SourcePath = Join-Path $Node.Source "Test.zip"
                DestinationPath = Join-Path $Node.DestinationPath "Test$i.zip"
                MatchSource = $true
                Force = $true
                Checksum = "modifiedDate" 
                Credential = $Node.Credential
            }
        }
    }
}

I want to know why this is, has anyone managed to get this working for the file resource? Thanks.

Mike Sherrill 'Cat Recall'
  • 91,602
  • 17
  • 122
  • 185
John
  • 1,566
  • 6
  • 17
  • 28
  • 1
    Can you show us the actual DSC configuration? – briantist Apr 24 '15 at 15:49
  • I've added an example configuration that has this issue. – John Apr 24 '15 at 17:31
  • 2
    what credentials do you use ? Are you able to map a network share using with them ? – Loïc MICHEL May 04 '15 at 13:03
  • I'm using Administrator account for the machine with the share. I just tried mapping it using net use and it returns the message: Multiple connections to a server or shared resource by the same user, using more than one user name, are not allowed. Disconnect all previous connections to the server or shared resource and try again. Using netstat I can see that there are several connections open to and from port 445 (share) on the system process. So no, I am not able to map a network share. – John May 05 '15 at 14:32
  • 1
    Try to reboot first if it still not working search the UNC in the registry and delete the keys – Loïc MICHEL May 05 '15 at 15:33
  • So that definitely helped. It managed to transfer some files to each of the target machines after restarting. But it reaches a point in the middle of the configuration which unzips a file and that takes a while, after that point I get the same old "A specified logon session does not exist." I guess it's because of this multiple connections which presumably something is creating and leaving about? – John May 05 '15 at 17:19
  • There is no unzipping in the example config can you provide the full config? – TravisEz13 May 30 '16 at 16:47

0 Answers0