Installation for user profiles

I have a challenge with the installation. The installation should reach all existing and future user profiles on one computer. How can I achieve the transfer of the paths to the registry?

In this path it should be copied at the users:
APPDATA=C:\Users%ProfileName%\AppData\Roaming\Company
LOCALAPPDATA=C:\Users%ProfileName%\AppData\Local\Company\

I have tried the following without result:

$ProfilePaths = Get-UserProfiles | Select-Object -ExpandProperty 'ProfilePath'
ForEach ($Profile in $ProfilePaths){
$HKCURegistrySettings = {
set-registryKey -key 'HKCU\Software\Company\Apllication\Settings' -name 'FileStorePath' -value "C:\\Users\\$ProfilePaths\\AppData\\Local\\Company\\App Add-in\\" -type string -SID $UserProfile.SID
set-registrykey -key 'HKCU\Software\Company\Apllication\Settings' -name 'InstallLocation' -value "C:\\Users\\$UserProfile\\AppData\\Roaming\\Company\\App Add-in\\" -type string -SID $UserProfile.SID
set-registryKey -key 'HKCU\Software\Company\Apllication\Settings' -name 'FileStorePath' -value "C:\\Users\\$EnvUserName\\AppData\\Local\\Company\\App Add-in\\" -type string -SID $UserProfile.SID
set-registrykey -key 'HKCU\Software\Company\Apllication\Settings' -name 'InstallLocation' -value "C:\\Users\\$Profile\\AppData\\Roaming\\Company\\App Add-in\\" -type string -SID $UserProfile.SID}
}
Invoke-HKCURegistrySettingsForAllUsers -RegistrySettings $HKCURegistrySettings

Thanks in advance for your support.

Invoke-HKCURegistrySettingsForAllUsers will only work for existing users and is a bit tricky to use.

I prefer Active Setup over Invoke-HKCURegistrySettingsForAllUsers because it works without of PSADT or SCCM.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.