Giter Site home page Giter Site logo

activedirectorydsc.reverse's Introduction

ReverseDSC Orchestrator for Active Directory

This module allows you to extract the current configuration Active Directory as a PowerShell Desired State Configuration (DSC) .ps1 script along with its associated .psd1 Configuration Data File. With these files you can then recreate an exact copy of AD environment.

How to Use

The ReverseDSC Orchestrator for Active Directory needs to be installed on a server that has the AD Domain Services Role.

Install with internet access

If your machine has internet connectivity, it can be automatically installed using PowerShell 5 and above. This will automatically install the orchestrator and all the modules it depends on. The command to run is:

Install-Script ActiveDirectoryDSC.Reverse

Install without internet access

If the server doesn't have internet connectivity, then you will need to run the "Install-Script ActiveDirectoryDSC.Reverse" command from a computer that has PowerShell version 5 or greater and that had internet connectivity and copy the files manually over the server. Once the command has been run on the machine with internet connectivity, copy the following files to the exact same location on the server:

  • C:\Program Files\WindowsPowerShell\Modules\xActiveDirectory [Entire Folder]
  • C:\Program Files\WindowsPowerShell\Modules\ReverseDSC [Entire Folder]
  • C:\Program Files\WindowsPowerShell\Scripts\ActiveDirectoryDSC.Reverse.ps1 [If folder doesn't exist on server, create it manually]

Run

Once you have either run Install-Script ActiveDirectoryDSC.Reverse or have copied over the files, connect to the AD server using a Domain Admin account and open a new PowerShell console as an administrator on the server. Browse to the C:\Program Files\WindowsPowerShell\Scripts folder and execute the ActiveDirectoryDSC.Reverse.ps1 script.

Output

As an output, the Orchestrator script will produce a .ps1 file representing the configuration logic for your environment, and a .psd1 file that will be used as Configuration Data to compile the associated MOF file. If you are planning on using ReverseDSC to replicate your AD in another environment, you will need to modify the values in the .psd1 Configuration Data file before compiling your MOF files. Any errors encountered during the extraction will be included in a file named DSC.log inside the specified folder.

activedirectorydsc.reverse's People

Contributors

microsoft-github-policy-service[bot] avatar microsoftopensource avatar msftgits avatar nikcharlebois avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

activedirectorydsc.reverse's Issues

Clarification of functionality

Details of the scenario you try and problem that is occurring:

We are using the provided powershell module on a Windows Server 2016 to replicate our Active Directory (forest and domain functional level 2016). After execution, the output folder contains only a .ps1 file containing only AD users. No .psd1 is generated and no error is printed.

From the README, we expected the module to replicate our AD. Currently, I see only users being replicated. Are we assessing the situation correctly?

The DSC configuration that is using the resource:

Version of the Operating System and PowerShell the DSC Target Node is running:

  • Windows Server 2016 (forest and domain functional level 2016)
  • PowerShell version
$PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.14393.3471
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14393.3471
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Version of the DSC module you're using:

Latest master e58afec

Getting Error with Get-TargetResource

When trying to run this in my active directory environment, i keep getting the following errors:

Get-TargetResource : The term 'Get-TargetResource' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Program Files\WindowsPowerShell\Scripts\ActiveDirectoryDSC.Reverse.ps1:115 char:24

  •         $results = Get-TargetResource @params
    
  •                    ~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : ObjectNotFound: (Get-TargetResource:String) [], CommandNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException

Get-DSCBlock : Cannot bind argument to parameter 'Params' because it is null.
At C:\Program Files\WindowsPowerShell\Scripts\ActiveDirectoryDSC.Reverse.ps1:119 char:62

  • ... $Script:dscConfigContent += Get-DSCBlock -Params $results -Module ...
  •                                                      ~~~~~~~~
    
    • CategoryInfo : InvalidData: (:) [Get-DSCBlock], ParameterBindingValidationException
    • FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Get-DSCBlock

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.