@@ -265,9 +265,10 @@ xVirtualMemory has the following properties:
265265
266266## Examples
267267
268- ### Change the Name and the Workgroup Name
268+ ### Set the Name and the Workgroup Name
269269
270- This configuration will set a machine name and changes the workgroup it is in.
270+ This configuration will set the computer name to 'Server01'
271+ and make it part of 'ContosoWorkgroup' Workgroup.
271272
272273``` powershell
273274Configuration Example
@@ -276,15 +277,7 @@ Configuration Example
276277 (
277278 [Parameter()]
278279 [System.String[]]
279- $NodeName = 'localhost',
280-
281- [Parameter(Mandatory = $true)]
282- [System.String]
283- $MachineName,
284-
285- [Parameter(Mandatory = $true)]
286- [System.String]
287- $WorkGroup
280+ $NodeName = 'localhost'
288281 )
289282
290283 Import-DscResource -Module xComputerManagement
@@ -293,17 +286,18 @@ Configuration Example
293286 {
294287 xComputer NewNameAndWorkgroup
295288 {
296- Name = $MachineName
297- WorkGroupName = $WorkGroup
289+ Name = 'Server01'
290+ WorkGroupName = 'ContosoWorkgroup'
298291 }
299292 }
300293}
301294```
302295
303296### Switch from a Workgroup to a Domain
304297
305- This configuration sets the machine name and joins a domain.
306- Note: this requires a credential.
298+ This configuration sets the machine name to 'Server01' and
299+ joins the 'Contoso' domain.
300+ Note: this requires an AD credential to join the domain.
307301
308302``` powershell
309303Configuration Example
@@ -314,14 +308,6 @@ Configuration Example
314308 [System.String[]]
315309 $NodeName = 'localhost',
316310
317- [Parameter(Mandatory = $true)]
318- [System.String]
319- $MachineName,
320-
321- [Parameter(Mandatory = $true)]
322- [System.String]
323- $DomainName,
324-
325311 [Parameter(Mandatory = $true)]
326312 [ValidateNotNullorEmpty()]
327313 [System.Management.Automation.PSCredential]
@@ -334,18 +320,20 @@ Configuration Example
334320 {
335321 xComputer JoinDomain
336322 {
337- Name = $MachineName
338- DomainName = $DomainName
323+ Name = 'Server01'
324+ DomainName = 'Contoso'
339325 Credential = $Credential # Credential to join to domain
340326 }
341327 }
342328}
343329```
344330
345- ### Change the Name while staying on the Domain
331+ ### Set the Name while staying on the Domain
346332
347- This example will change the machines name while remaining on the domain.
348- Note: this requires a credential.
333+ This example will set the machines name 'Server01' while remaining
334+ joined to the current domain.
335+ Note: this requires a credential for renaming the machine on the
336+ domain.
349337
350338``` powershell
351339Configuration Example
@@ -356,10 +344,6 @@ Configuration Example
356344 [System.String[]]
357345 $NodeName = 'localhost',
358346
359- [Parameter(Mandatory = $true)]
360- [System.String]
361- $MachineName,
362-
363347 [Parameter(Mandatory = $true)]
364348 [ValidateNotNullorEmpty()]
365349 [System.Management.Automation.PSCredential]
@@ -372,16 +356,17 @@ Configuration Example
372356 {
373357 xComputer NewName
374358 {
375- Name = $MachineName
359+ Name = 'Server01'
376360 Credential = $Credential # Domain credential
377361 }
378362 }
379363}
380364```
381365
382- ### Change the Name while staying on the Workgroup
366+ ### Set the Name while staying on the Workgroup
383367
384- This example will change the machines name while remaining in the workgroup.
368+ This example will set the machine name to 'Server01' while remaining
369+ in the workgroup.
385370
386371``` powershell
387372Configuration Example
@@ -390,32 +375,25 @@ Configuration Example
390375 (
391376 [Parameter()]
392377 [System.String[]]
393- $NodeName = 'localhost',
394-
395- [Parameter(Mandatory = $true)]
396- [ValidateNotNullorEmpty()]
397- [System.Management.Automation.PSCredential]
398- $Credential
378+ $NodeName = 'localhost'
399379 )
400380
401- Import-DscResource -ModuleName xCertificate
381+ Import-DscResource -Module xComputerManagement
402382
403- Node $AllNodes. NodeName
383+ Node $NodeName
404384 {
405- xCertificateExport SSLCert
385+ xComputer NewName
406386 {
407- Type = 'PFX'
408- FriendlyName = 'Web Site SSL Certificate for www.contoso.com'
409- Path = 'c:\sslcert.cer'
410- Password = $Credential
387+ Name = 'Server01'
411388 }
412389 }
413390}
414391```
415392
416393### Switch from a Domain to a Workgroup
417394
418- This example switches the computer from a domain to a workgroup.
395+ This example switches the computer 'Server01' from a domain and joins it
396+ to the 'ContosoWorkgroup' Workgroup.
419397Note: this requires a credential.
420398
421399``` powershell
@@ -427,14 +405,6 @@ Configuration Example
427405 [System.String[]]
428406 $NodeName = 'localhost',
429407
430- [Parameter(Mandatory = $true)]
431- [System.String]
432- $MachineName,
433-
434- [Parameter(Mandatory = $true)]
435- [System.String]
436- $WorkGroup,
437-
438408 [Parameter(Mandatory = $true)]
439409 [ValidateNotNullorEmpty()]
440410 [System.Management.Automation.PSCredential]
@@ -447,8 +417,8 @@ Configuration Example
447417 {
448418 xComputer JoinWorkgroup
449419 {
450- Name = $MachineName
451- WorkGroupName = $WorkGroup
420+ Name = 'Server01'
421+ WorkGroupName = 'ContosoWorkgroup'
452422 Credential = $Credential # Credential to unjoin from domain
453423 }
454424 }
0 commit comments