I have a problem with taking ownership of C:\Windows\System32\termsrv.dll.
When I run my script from a elevated powershell prompt :
I got the following error message:
The script is working perfectly if I'm trying to take ownership of a file that is not owned by "TrustedInstaller".
I have to note that i can take ownership by the normal properties->security window.
Anyone that can explain what I'm doing wrong? I would be very thankful
When I run my script from a elevated powershell prompt :
Code:
$dir = 'C:\Windows\System32\termsrv.dll'
$domain = $env:USERDNSDOMAIN
$user = $env:USERNAME
#Get current permissions
$ACL = Get-Acl -Path $dir
#Set Owner of file
$ACL.SetOwner([System.Security.Principal.NTAccount]“Administrators“)
Set-Acl -Path $dir $ACL
I got the following error message:
The script is working perfectly if I'm trying to take ownership of a file that is not owned by "TrustedInstaller".
I have to note that i can take ownership by the normal properties->security window.
Anyone that can explain what I'm doing wrong? I would be very thankful
My Computer
System One
-
- OS
- Windows 8.1 Professional 64-Bit
- Computer type
- PC/Desktop
- System Manufacturer/Model
- Custom build
- CPU
- Intel core i7 950 @3,07 Stock
- Motherboard
- AsRock X58 Extreme 3
- Memory
- Corsair 6x2 GB
- Graphics Card(s)
- Nvidia GeForce GTX 460 1GB
- Monitor(s) Displays
- Benq G2420HDB 24" [TN]/Fuijitsu THOR 23" [IPS]
- Screen Resolution
- 1920x1080
- Hard Drives
- Corsair F60 [SSD] OS Disk
WD Black 750GB [HDD] Raid 0
Segate Baracuda 1 TB [HDD] Raid 0
- PSU
- Corsair VX 550W
- Case
- HAF X
- Cooling
- Corsair H100
- Keyboard
- Microsoft SideWinder X4
- Mouse
- Razer Deathadder
- Internet Speed
- 20/2 Telia ADSL
- Browser
- FireFox
- Antivirus
- Microsoft security essentials