Copy to App data All users

I wanted to copy a config file which sits in the roaming app data of a user profile.I could do this with group policy but wanted to do this as part of the SCCM install .

Using PowerShell i was able to do this with the * parameter

$Source = “$PSScriptRoot\The folder that needs copying”
$Destination = ‘C:\users\*\AppData\Roaming\’
Get-ChildItem $Destination | ForEach-Object {Copy-Item -Path $Source -Destination $_ -Force -Recurse}
New-Item ‘HKLM:\System\SCCMApps\What ever you want to use for detection’ -Force | New-ItemProperty -Name Version1.0 -Value 1 -Force | Out-Null

I have also added a reg key for my detection method as the is more reliable than using the folder in app data

Capture.JPG

Capture2.JPG