tag:blogger.com,1999:blog-8229131257128040189.post1725184812034872361..comments2023-04-11T11:36:03.057+01:00Comments on Think Big - with Powershell: Edit MultiString registry value remotely - OSTompahttp://www.blogger.com/profile/00462564333522996562noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-8229131257128040189.post-73266267324853448072017-04-11T14:29:25.585+01:002017-04-11T14:29:25.585+01:00Glad it was useful, Master JediGlad it was useful, Master JediTompahttps://www.blogger.com/profile/00462564333522996562noreply@blogger.comtag:blogger.com,1999:blog-8229131257128040189.post-24607209036876049142017-04-11T02:10:54.632+01:002017-04-11T02:10:54.632+01:00Nice one! Nice one! Levihttps://www.blogger.com/profile/04562801758997612435noreply@blogger.comtag:blogger.com,1999:blog-8229131257128040189.post-52260149534118659822014-08-30T11:01:43.469+01:002014-08-30T11:01:43.469+01:00hi, the array you are committing to the registry (...hi, the array you are committing to the registry ($newarray) should contain the values in the order you want them to be in the registry. If you want to get rid of the original values, just don't execute lin $newarray += $array, so basically don't add whatever was originally in that Value. But, be careful, you really need to make sure you are adding stuff into the registry you really want. So test it with a mockup registry value. Tompahttps://www.blogger.com/profile/00462564333522996562noreply@blogger.comtag:blogger.com,1999:blog-8229131257128040189.post-82260449788970086712014-08-25T21:04:34.671+01:002014-08-25T21:04:34.671+01:00Great article but ... How do I rearrange the value...Great article but ... How do I rearrange the values w/o losing what is already there. I have been trying to edit "Bind" under SYSTEM\\CurrentControlSet\\services\\Tcpip\\Linkage to change the binding order of NICs...but it just adds the extra values so what was earlier 3 entries now becomes 6. How do I rearrange w/o adding additional entries ...here is my script ...<br />$PrimaryNIC = Invoke-command -ComputerName $Server -cred $cred -ScriptBlock {Get-NetAdapter -Name Pri | select -Property InterfaceGUID -ExpandProperty InterfaceGUID} #--> Working<br />$SecondaryNIC = Invoke-command -ComputerName $Server -cred $cred -ScriptBlock {Get-NetAdapter -Name Sec | select -Property InterfaceGUID -ExpandProperty InterfaceGUID} #--> Working<br />$Array = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine',"$server").OpenSubKey("SYSTEM\\CurrentControlSet\\services\\Tcpip\\Linkage",$true).GetValue("Bind")<br />[string[]]$newArray = @("\Device\$PrimaryNIC","\Device\$SecondaryNIC")<br />$newarray += $array<br />[Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine',"$server").OpenSubKey("SYSTEM\\CurrentControlSet\\services\\Tcpip\\Linkage",$true).SetValue('Bind', $newarray,'MultiString')<br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8229131257128040189.post-51822929793588953212013-11-04T21:00:13.820+00:002013-11-04T21:00:13.820+00:00Hello Tom (I assume your name is Tom?) thanks very...Hello Tom (I assume your name is Tom?) thanks very much for posting very useful indeed.<br /><br />I had to make a slight adjustment to get it working for me e.g. using [string[]] (and array of strings) rather than [string] as follows<br /><br />$Array = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine',$ComputerName).OpenSubKey("SOFTWARE\Ernie",$true).GetValue("Version3")<br /><br />[String[]]$newArray = @("newitem")<br /><br />$newarray += $array<br />[Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine',$ComputerName).OpenSubKey("SOFTWARE\Ernie",$true).SetValue('Version3', $newarray,'MultiString')<br /><br />Thanks again, very helpful tip, I will subscribe to your blog<br /><br />Ernie<br />ErnestBrant@Hotmail.co.ukAnonymousnoreply@blogger.com