Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Add multi-value Registery entries

$
0
0

Hello All,

I am trying to use the below script to add multi-value registry key

the script is working fine except he is writting only the last value of the variable

any help please

Add-PSSnapin Quest.ActiveRoles.ADManagement
$data= get-QADUser $env:USERNAME -IncludedProperties MemberOf
$1= $data.memberof  -split(",OU") -split "CN=" | Select-String -AllMatches "_Teachers" 
$2 = $1 -creplace "_Teachers", "*"
Foreach($item in $2){
$item 
REG add "HKCU\Volatile Environment" /v Impero_PopulateMyPersonalGroupWithUsers /t REG_MULTI_SZ  /s "," /d "[$item]" /f}



Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>