------------------
If you've installed and registered ADsSecurity.DLL from the SDK, you can
manipulate the Owner property of the Security Descriptor, then update it
with IADsSecurityUtility::SetSecurityDescriptor method.
------------------
++++++++++++++++++++++++++++++
Option Explicit
Dim sec, sd
Set sec = Wscript.CreateObject("ADsSecurity")
Set sd = sec.GetSecurityDescriptor("FILE://c:\test\test")
wScript.Echo "Control Flag: " & sd.Control & vbCrLf & "Group Owner: " & _
sd.Group & vbCrLf & "Owner: " & sd.Owner & vbCrLf & _
"SD Revision: " & sd.Revision
sd.Owner="<DOMAIN>\newowner" 'I've only tried the "standard Windows"
syntax
sec.SetSecurityDescriptor sd
Set sec = Nothing
Set sec = Wscript.CreateObject("ADsSecurity")
Set sd = sec.GetSecurityDescriptor("FILE://c:\test\test")
wScript.Echo "Control Flag: " & sd.Control & vbCrLf & "Group Owner: " & _
sd.Group & vbCrLf & "Owner: " & sd.Owner & vbCrLf & _
"SD Revision: " & sd.Revision
++++++++++++++++++++++++++++++
Quote:
> Is it possible to programatically change the owner of a file using
vbscript?
> I can add a security entry to the ACL on a file, but I do not see how to
> change the ownership of the file.
> Thanks in advance for any help you can provide.