I am wondering what a line of PowerShell code means. - Microsoft Community


i teaching myself powershell , how used in managing active directory.  i know how manage ad via gui.

the textbook i'm reading dealing adding access rule access control object.  i understand text example, don't understand why textbook example starts code line:  set-alias no new-object.  i don't understand means , can't seem find explanation.  i understand set-alias , new-object cmdlets, have no idea "no" there for.  any assistance appreciated.  thanks.

i teaching myself powershell , how used in managing active directory.  i know how manage ad via gui.

the textbook i'm reading dealing adding access rule access control object.  i understand text example, don't understand why textbook example starts code line:  set-alias no new-object.  i don't understand means , can't seem find explanation.  i understand set-alias , new-object cmdlets, have no idea "no" there for.  any assistance appreciated. 

     also, why there "no"in 4th line of code, new access rule added directory's access control object?

     thanks assistance in matter!

in first post didn't include code block.  here is:

set-alias no new-object

$acl = get-acl c:\logs
$perm = "room5\test","fullcontrol","allow"
$r = no system.security.accesscontrol.filesystemaccessrule $perm
$acl.addaccessrule($r)

$resc = gci c:\logs -recurse -force 
foreach($f in $resc) { 

  write-host $f.fullname
  $acl | set-acl $f.fullname
}



Windows / Windows 10 / Network & internet / PC



Comments

Popular posts from this blog

Error 0x80180018 when trying to add a second work account on Windows - Microsoft Community

How to sync (or sign-in) to Windows 10 properly? - Microsoft Community

Cannot connect to RDS 2012R2 session through RDWeb Gateway using - Microsoft Community