Created
March 9, 2021 19:23
-
-
Save signalwarrant/5d69f6cfda2f5a6c27ac870d83c2e6a6 to your computer and use it in GitHub Desktop.
ExchangeSVCmofPush.ps1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Your Configuration | |
| Configuration ExchangeService { | |
| # Parameters | |
| # Accepts a string value computername or defaults to localhost | |
| Param([string[]]$ComputerName = "localhost") | |
| # Target Node | |
| Node $ComputerName { | |
| # Service Resource | |
| # Ensure a service is started | |
| Service MSExchangeTransport { | |
| Name = 'MSExchangeTransport' | |
| State = 'Running' | |
| } | |
| } | |
| } | |
| # Generate the .MOF files | |
| ExchangeService -ComputerName EXCH | |
| # MOF files are created in whatever directory you're in in the PS Console | |
| # 1 MOF file per target node | |
| # Apply the configuration | |
| Start-DscConfiguration -path ExchangeService -Wait -Verbose -Force | |
| # View Deployed Configurations | |
| Get-DscConfiguration -CimSession EXCH | |
| #Testing Config (detect drift) | |
| Test-DscConfiguration -CimSession EXCH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment