0

Im trying to set a new owner in Powershell but the problem is that I dont know exactly what to put

I have this:

$person="Bob"
$acl.SetOwner([System.Security.Principal.NTAccount] $person)

But what I need to put is a username that I grab from the current user that is logged in.

How do I get the current user logged in?

riahc3
  • 857
  • 4
  • 10
  • 23
  • So: $person="Bob" $acl.SetOwner([System.Security.Principal.NTAccount] $env:USERNAME) – riahc3 Jul 29 '15 at 13:03
  • no, just $acl.SetOwner([System.Security.Principal.NTAccount] $env:USERNAME). You should invest some time and search / try yourself before you ask here – Martin Brandl Jul 29 '15 at 13:09

0 Answers0