7 lines
469 B
VB.net
7 lines
469 B
VB.net
Public Class cPowershellScripts
|
|
|
|
Public Shared userprofile As String = "$openfiles = Get-SmbOpenFile | select-object ShareRelativePath | out-string -stream ; foreach ($file in $openfiles) { try{ if ($file.length -gt 40) { $i = $file.substring(5,43); $SID = New-Object System.Security.Principal.SecurityIdentifier($i); $User = $SID.Translate([System.Security.Principal.NTAccount]); $U = $User.Value; write-host $i $U; $R.add($file + $i)}} catch {} }"
|
|
|
|
|
|
End Class
|