Loading |
VBScript |
JavaScript |
Powershell |
Search Options: Determine the Owner of a FileContent of Determine the Owner of a File.vbsMD5 Hash: 2CDA20284D850BDDE1D0AEA9F472C45A |
||
On Error Resume Next
strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") strFile = "C:\Scripts\My_script.vbs" Set colItems = objWMIService.ExecQuery _ ("ASSOCIATORS OF {Win32_LogicalFileSecuritySetting='" & strFile & "'}" _ & " WHERE AssocClass=Win32_LogicalFileOwner ResultRole=Owner") For Each objItem in colItems Wscript.Echo objItem.ReferencedDomainName Wscript.Echo objItem.AccountName Next | ||
© 2008 - 2013 Boris Toll :: Scripts available: 6.481 :: :: scriptbox.toll.at :: :: powered by www.toll.at :: |