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?

2
  • So: $person="Bob" $acl.SetOwner([System.Security.Principal.NTAccount] $env:USERNAME) Commented Jul 29, 2015 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 Commented Jul 29, 2015 at 13:09

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.