Examples/Resources/Computer/5-Computer_UnjoinDomainAndJoinWorkgroup_Config.ps1
<#PSScriptInfo .VERSION 1.0.0 .GUID 9625caff-9065-4d04-9585-934998d81591 .AUTHOR Microsoft Corporation .COMPANYNAME Microsoft Corporation .COPYRIGHT (c) Microsoft Corporation. All rights reserved. .TAGS DSCConfiguration .LICENSEURI https://github.com/PowerShell/ComputerManagementDsc/blob/master/LICENSE .PROJECTURI https://github.com/PowerShell/ComputerManagementDsc .ICONURI .EXTERNALMODULEDEPENDENCIES .REQUIREDSCRIPTS .EXTERNALSCRIPTDEPENDENCIES .RELEASENOTES First version. .PRIVATEDATA 2016-Datacenter,2016-Datacenter-Server-Core #> #Requires -module ComputerManagementDsc <# .DESCRIPTION This example switches the computer 'Server01' from a domain and joins it to the 'ContosoWorkgroup' Workgroup. Note: this requires a credential. #> Configuration Computer_UnjoinDomainAndJoinWorkgroup_Config { param ( [Parameter(Mandatory = $true)] [ValidateNotNullorEmpty()] [System.Management.Automation.PSCredential] $Credential ) Import-DscResource -Module ComputerManagementDsc Node localhost { Computer JoinWorkgroup { Name = 'Server01' WorkGroupName = 'ContosoWorkgroup' Credential = $Credential # Credential to unjoin from domain } } } |