Closed Rockavina closed 4 years ago
Thanks! Can you share your code?
Sure, can't really do a pull request since you've signed the source scripts, so I'll just share here. Basically it'll work like before, but you can override the defaults with a parameter
Added parameter: [string]$RasphonePath Added comment help for RasphonePath
Modified RasphonePath definition:
# // Define rasphone.pbk file path
if (-not $RasphonePath -and $AllUserConnection) {
$RasphonePath = 'C:\ProgramData\Microsoft\Network\Connections\Pbk\rasphone.pbk'
}
Elseif(-not $RasphonePath) {
$RasphonePath = "$env:appdata\Microsoft\Network\Connections\Pbk\rasphone.pbk"
}
Then I can pass the path from calling script, e.g:
$RasphonePath = "C:\Users\user1\AppData\Roaming\microsoft\network\Connections\Pbk\rasphone.pbk"
.\Update-Rasphone.ps1 -RasphonePath $RasphonePath -ProfileName $ProfileName -InterfaceMetric 10
Thanks! I'll incorporate this in to the next update for sure. :)
Thanks again for the heads up on this. I'll be uploading a new script shortly.
Config Manager install package runs in system context for the user profile, so pbk path will default to system path instead of user path.
I've solved this by adding RasphonePath as an optional parameter and passing this from the profile install script, which already pulls the username from wmi.