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

RSOP not including LcmConfig (because it's static) #75

Closed
raandree opened this issue Aug 30, 2019 · 2 comments
Closed

RSOP not including LcmConfig (because it's static) #75

raandree opened this issue Aug 30, 2019 · 2 comments

Comments

@raandree
Copy link
Contributor

Usually every bit of config data is visible in the RSOP output. But the LCM settings are missing the pull server URI and the RegistrationKey which is in the Meta MOFs (so it does exist) but not in the RSOP.

A repo is here: https://github.com/raandree/DatumTest

The RSOP output for node PreServer1

Environment: Pre
Description: CoreDC in CSPre
Name: PreServer1
PSDscAllowPlainTextPassword: true
LcmConfig:
  ConfigurationRepositoryWeb:
    Server:
      ConfigurationNames: PreServer1
SoftwarePackages:
  Package:
  - Name: Password Policy Enforcer 9.1
    Ensure: Present
    Path: D:\Packages\PPE\PPE910.msi
    ProductId: 55EBFC31-1031-463C-A870-416E2C312A64
PSDscAllowDomainUser: true
Configurations:
- FilesAndFolders
- SoftwarePackages
- WindowsFeatures
Role: CoreDC
WindowsFeatures:
  Name:
  - -Telnet-Client
FilesAndFolders:
  Items:
  - DestinationPath: C:\Test\Frankfurt
    Type: Directory
Location: Frankfurt
NodeName: PreServer1

The meta.mof with the content that is missing in RSOP.

/*
@TargetNode='PreServer1'
@GeneratedBy=randr
@GenerationDate=08/30/2019 13:24:26
@GenerationHost=RAANDREE0
*/

instance of MSFT_WebDownloadManager as $MSFT_WebDownloadManager1ref
{
SourceInfo = "::6::2::ConfigurationRepositoryWeb";
 ServerURL = "https://PrePull.contoso.com/PSDSCPullServer.svc";
 ResourceID = "[ConfigurationRepositoryWeb]Server";
 RegistrationKey = "fbc6ef09-ad98-4aad-a062-92b0e0327562";
 ConfigurationNames = {
    "PreServer1"
};

};

instance of MSFT_WebReportManager as $MSFT_WebReportManager1ref
{
SourceInfo = "::6::2::ReportServerWeb";
 ServerURL = "https://PrePull.contoso.com/PSDSCPullServer.svc";
 ResourceID = "[ReportServerWeb]ReportServerWeb";
 RegistrationKey = "fbc6ef09-ad98-4aad-a062-92b0e0327562";

};

instance of MSFT_DSCMetaConfiguration as $MSFT_DSCMetaConfiguration1ref
{
RefreshMode = "Pull";
 AllowModuleOverwrite = True;
 ActionAfterReboot = "ContinueConfiguration";
 RefreshFrequencyMins = 30;
 RebootNodeIfNeeded = True;
 ConfigurationModeFrequencyMins = 30;
 ConfigurationMode = "ApplyAndMonitor";

  ReportManagers = {
  $MSFT_WebReportManager1ref  
 };
  ConfigurationDownloadManagers = {
  $MSFT_WebDownloadManager1ref  
 };
};

instance of OMI_ConfigurationDocument
{
 Version="2.0.0";
 MinimumCompatibleVersion = "2.0.0";
 CompatibleVersionAdditionalProperties= { "MSFT_DSCMetaConfiguration:StatusRetentionTimeInDays" };
 Author="randr";
 GenerationDate="08/30/2019 13:24:26";
 GenerationHost="RAANDREE0";
 Name="RootMetaMOF";
};

Is this by design or does something go wrong?

@gaelcolas
Copy link
Owner

gaelcolas commented Aug 30, 2019

Yeah, by design. Can be suboptimal but not a lot of effort has been put in Get-DatumRsop.
In short, this function only lookup based on the Configurations pivot.

For a given node it resolves the array of configurations items from the 'configurations' key.
Then for each configuration, does a lookup of that config for that node and merge into the root node element.

So it builds the rsop by doing a Lookup foreach item in the configurations key, because that's the only thing we know (the pivot).

If we'd want to add the LCM configs, we ought to do something similar than what you can find in RootMetaMof.ps1:
Adding here the following...

$RSOPNode.Add('LcmConfig',@{})
'LcmConfig\Settings','LcmConfig\ConfigurationRepositoryShare','LcmConfig\ResourceRepositoryShare','LcmConfig\ConfigurationRepositoryWeb','LcmConfig\ResourceRepositoryWeb','LcmConfig\ReportServerWeb','LcmConfig\PartialConfiguration' | % { $KeyToAddToNode = Resolve-NodeProperty -PropertyPath $_ -DefaultValue $null; $RSOPNode.LcmConfig[$_] = $KeyToAddToNode;  }

This is rough and not tested, but illustrates the idea :)

@gaelcolas gaelcolas changed the title RSOP incomplete RSOP not including LcmConfig (because it's static) Aug 30, 2019
@raandree
Copy link
Contributor Author

Solved in b7da69d.

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

No branches or pull requests

2 participants