|
|
@ -18,7 +18,7 @@ |
|
|
|
Thanks to all https://forum.ru-board.com members involved |
|
|
|
|
|
|
|
.NOTES |
|
|
|
Supported Windows 10 x64 Enterprise LTSC 2019 |
|
|
|
Supports Windows 10 x64 Enterprise LTSC 2019 |
|
|
|
|
|
|
|
.LINK |
|
|
|
https://github.com/farag2/Sophia-Script-for-Windows |
|
|
@ -9007,7 +9007,7 @@ function CleanupTask |
|
|
|
} |
|
|
|
|
|
|
|
# Convert SID to username |
|
|
|
$TaskUserAccount = (New-Object System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 |
|
|
|
$TaskUserAccount = (New-Object -TypeName System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 |
|
|
|
|
|
|
|
if ($TaskUserAccount -ne $env:USERNAME) |
|
|
|
{ |
|
|
@ -9447,7 +9447,7 @@ function SoftwareDistributionTask |
|
|
|
} |
|
|
|
|
|
|
|
# Convert SID to username |
|
|
|
$TaskUserAccount = (New-Object System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 |
|
|
|
$TaskUserAccount = (New-Object -TypeName System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 |
|
|
|
|
|
|
|
if ($TaskUserAccount -ne $env:USERNAME) |
|
|
|
{ |
|
|
@ -9765,7 +9765,7 @@ function TempTask |
|
|
|
} |
|
|
|
|
|
|
|
# Convert SID to username |
|
|
|
$TaskUserAccount = (New-Object System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 |
|
|
|
$TaskUserAccount = (New-Object -TypeName System.Security.Principal.SecurityIdentifier($SID)).Translate([System.Security.Principal.NTAccount]).Value -split "\\" | Select-Object -Last 1 |
|
|
|
|
|
|
|
if ($TaskUserAccount -ne $env:USERNAME) |
|
|
|
{ |
|
|
|