Skip to content

Instantly share code, notes, and snippets.

/xml

Created June 9, 2017 13:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/c9e40043105374c95ab4bc67bd69f1f6 to your computer and use it in GitHub Desktop.
Save anonymous/c9e40043105374c95ab4bc67bd69f1f6 to your computer and use it in GitHub Desktop.
[xml]$xml2 = @'
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="specialize">
<component name="" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State">
<Identification>
<Credentials>
<Username>
</Username>
<Domain>
</Domain>
<Password>
</Password>
</Credentials>
<JoinDomain>
</JoinDomain>
<JoinWorkgroup>
</JoinWorkgroup>
<MachineObjectOU>
</MachineObjectOU>
</Identification>
</component>
<component name="Microsoft-Windows-" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State">
<ComputerName>
</ComputerName>
<ProductKey>
</ProductKey>
<RegisteredOrganization>xxxx Group Headquarters, IT Services</RegisteredOrganization>
</component>
</settings>
</unattend>
'@
$registeredorganization = "PowerShell.org"
$xml2.unattend.settings.component.registeredorganization
($xml2.unattend.settings.component | Where-Object {$_.Name -eq "Microsoft-Windows-"}).registeredorganization = $registeredorganization
$xml2.unattend.settings.component.registeredorganization
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment