2017-11-22 21 views
0

저는 DSC을 처음 사용하기 때문에 SMB 끌어 오기 서버에서 작동하는 메타 구성을 며칠 동안 사용해 보았습니다. 아무 소용이.LCM의 메타 구성 (PS 4.0)에 SMB 풀 서버의 암호화 된 자격 증명을 저장하지 못했습니다.

상황 :

  • 대상 노드가 승리 2012 R2 서버입니다, 동일 도메인의 구성원은
  • 난 단지 사용할 수있는 PS 4.0 나는에 SMB 공유에 모든 사람에게 읽기 액세스 권한을 줄 수
  • 나는
  • 내 저작 노드가 현재 내 테스트 대상 노드
  • 입니다 (단 기본 PS 4.0 설치) 기능으로 사용자 정의 모듈에 의존 풀 모드를 갖고 싶어하지 않는 서버 당겨
  • 나는 New-SelfsignedCertificateEx.ps1를 사용하려하지만 자체 서명 된 인증서를 사용하고
  • 내 메타 구성이 작동 KUS 및 EKUs를 요청하여 Windows 10에서 생성 된 7 내 Windows에서 실행할 수 없습니다

나는 웹을 검색해 왔지만 코드 예제 나 DSC 리소스로 전달 된 자격 증명에 대한 질문 만 발견했습니다. 자격 증명이없는 SMB 공유 (테스트 대상 노드 자체가 호스팅/모든 사용자에게 읽기 액세스). 라이브 PSCredential 개체 (Get-Credential cmdlet에서 검색 됨)가 메타 구성 mof로 즉석에서 암호화 된 PS 4.0 코드 예제를 찾지 못했습니다.

나는 (herehere에서 포함) 수많은 예를 트랜스하려고했지만, 나는 나의 자격 증명을 암호화해야하고 아직도 잘 알려진 메시지마다 얻을 수 없습니다 해요 :

ConvertTo-MOFInstance : System.InvalidOperationException error processing property 'Credential' OF TYPE 'LocalConfigurationManager': Converting and 
storing encrypted passwords as plain text is not recommended. For more information on securing credentials in MOF file, please refer to MSDN blog: 
http://go.microsoft.com/fwlink/?LinkId=393729 
At line:190 char:16 
+  $aliasId = ConvertTo-MOFInstance $keywordName $canonicalizedValue 
+    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    + CategoryInfo   : InvalidOperation: (:) [Write-Error], InvalidOperationException 
    + FullyQualifiedErrorId : FailToProcessProperty,ConvertTo-MOFInstance 
Errors occurred while processing configuration 'MetaConfigurationForPull'. 
At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PSDesiredStateConfiguration\PSDesiredStateConfiguration.psm1:2223 char:5 
+  throw $errorRecord 
+  ~~~~~~~~~~~~~~~~~~ 
    + CategoryInfo   : InvalidOperation: (MetaConfigurationForPull:String) [], InvalidOperationException 
    + FullyQualifiedErrorId : FailToProcessConfiguration 

여기 내 코드 :

# Getting credentials for filer connection (CIFS share for pulling MOF files) 
$cred = Get-Credential -Message 'Provide credentials for CIFS share hosting configuration files:' 

Configuration MetaConfigurationForPull { 
    Param (
     [PSCredential] $Credential 
    ) 

    LocalConfigurationManager { 
     ConfigurationID = "f28a102c-71c9-43a1-abbb-a944ec7cb5cd"; 
     CertificateID = $AllNodes.Thumbprint; 
     Credential = $Credential; 
     RefreshMode = "PULL"; 
     RebootNodeIfNeeded = $false; 
     DownloadManagerName = "DscFileDownloadManager"; 
     DownloadManagerCustomData = @{SourcePath = '\\smb_pull_server\smb_share\mofs\batch_server'}; 
    } 
} 

$ConfigData= @{ 
    AllNodes = @(  
      @{ 
       # The name of the node we are describing 
       NodeName = "localhost" 

       # The path to the .cer file containing the 
       # public key of the Encryption Certificate 
       # used to encrypt credentials for this node 
       CertificateFile = "D:\node_rdp_cert.cer" 

       # The thumbprint of the Encryption Certificate 
       # used to decrypt the credentials on target node 
       Thumbprint = "d78334010df5dee5de1c7529e9419a4bb841e618" 
      }; 
     ); 
    } 

MetaConfigurationForPull -Credential $cred -ConfigurationData $ConfigData -Output "D:\meta\batch_server" 

가 나는 또한 PS 5.0 및 일부 회귀에 대해 이야기 that post을 발견 한이 사람은 그가 PS 4.0에 매력처럼 작동 모든 것을 한 상태 곳.

위의 코드에서 뭔가 빠졌습니까?
도움을 주시면 감사하겠습니다.

감사

+0

대답을 찾으십시오 ... LCM에서 SMB 풀 서버에 대한 액세스 자격 증명을 저장하지 못하게하는 알려진 버그가 있습니까? –

답변

0

는만큼이 단지 테스트 환경이다, 당신은 추가 할 수 있습니다

PSDscAllowPlainTextPassword = $true 

구성에.

예 : here.

+0

물론 이것으로 테스트 할 수는 있지만, 주요 관심사는 암호화가있는 프로덕션 환경에서이 작업을 수행하는 방법입니다. –

+0

LCM이 SMB 풀 서버에 대한 액세스 자격 증명을 저장하지 못하게하는 PS 4.0의 공식 버그가 있습니까? –