Is there a way to use Powershell DSC to READ an infrastructure and WRITE the output to a Powershell DSC file or mof file?
We have our environment fully configured already. I have been asked to look into using IAC to automate changes to that infrastructure from now on.
As it stands now, it is looking like I have a LOT of typing to do. lol
It would be nice if we can read the infrastructure and write to a file so its all mapped out.
I did it this way for our Databases using SSDT. We just imported the Schema to files and imported into our Version Control system.
It looks like we cannot do this for the network and server infrastructure. :|
It looks as if I am going to have to write out in Powershell DSC the entire expected state of our infrastructure by hand for each server etc...
Kinda yes, you can use reverse DSC to achieve that.
Most organizations already have an existing investment in technology solutions, and rewriting their imperative set of scripts into a declarative DSC configuration script is not a project everyone is willing to undertake. ReverseDSC is a module that provides a set of functions that can be used to reverse engineer an existing environment into a DSC script. That’s right, you can simply run a script against your existing complex environment, such as SharePoint, and automatically generate these 150,000 lines of DSC code that represent your environment. You don't need to do this manually.
Github link: https://github.com/Microsoft/ReverseDSC
There is also a custom IIS reverse DSC: https://github.com/kevinsea/dsc-generator