Advertisement
Guest User

Untitled

a guest
Oct 10th, 2017
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. Configuration MyDSC
  2. {
  3. param
  4. (
  5. [Parameter()]$Password
  6. )
  7.  
  8.  
  9. Node localhost
  10. {
  11. User MyUser
  12. {
  13. UserName = 'testman'
  14. Ensure = 'Present'
  15. Password = $Password
  16. }
  17.  
  18. }
  19. }
  20.  
  21. $configData = 'a'
  22.  
  23. $configData = @{
  24. AllNodes = @(
  25. @{
  26. NodeName = 'localhost';
  27. PSDscAllowPlainTextPassword = $true
  28. }
  29. )
  30. }
  31.  
  32.  
  33. MyDSC -Password (Get-Credential -UserName 'testman' -Message 'Enter New Password') -ConfigurationData $configData
  34. Start-DscConfiguration -ComputerName localhost -Wait -Force -Verbose -path .MyDSC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement