log sid and profilePath
This commit is contained in:
@@ -42,6 +42,9 @@ foreach ($sidItem in $sids) {
|
|||||||
$sid = $sidItem.PSChildName
|
$sid = $sidItem.PSChildName
|
||||||
$profilePath = (Get-ItemProperty -Path $sidItem.PSPath -Name ProfileImagePath).ProfileImagePath
|
$profilePath = (Get-ItemProperty -Path $sidItem.PSPath -Name ProfileImagePath).ProfileImagePath
|
||||||
|
|
||||||
|
Write-Host "$sid" -ForegroundColor Blue
|
||||||
|
Write-Host "$profilePath" -ForegroundColor Blue
|
||||||
|
|
||||||
foreach ($HKUsersPrinterPath in $HKUsersPrinterPaths) {
|
foreach ($HKUsersPrinterPath in $HKUsersPrinterPaths) {
|
||||||
try {
|
try {
|
||||||
Remove-Item -Path "Registry::HKEY_USERS\${sid}${HKUsersPrinterPath}" -Recurse -Force -ErrorAction Stop
|
Remove-Item -Path "Registry::HKEY_USERS\${sid}${HKUsersPrinterPath}" -Recurse -Force -ErrorAction Stop
|
||||||
|
|||||||
Reference in New Issue
Block a user