Google 网上论坛不再支持新的 Usenet 帖子或订阅项。历史内容仍可供查看。

NTFS file & folder permissions

已查看 6 次
跳至第一个未读帖子

MSN News Server

未读,
2001年5月29日 16:41:422001/5/29
收件人
Hi folks. I would like to VBscript (in logon script) NTFS file and folder
permissions. I'm having trouble finding how to do this...through FSO? Or is
it ADSI? Or WMI?

Any ideas, and of course any sample code or pointers would be appreciated.

Thanks

Marty Henderson
pcHouseCall
Mar...@pchcall.com


Marty Henderson

未读,
2001年5月29日 19:14:402001/5/29
收件人
I would like to script setting NTFS file/folder permissions via logon
script. How is this done? Via FSO? DMO? ADSI? WMI? Any quick samples?

Thanks,

Marty
pcHouseCall


Jeremy

未读,
2001年5月29日 21:46:502001/5/29
收件人
it's not vbscript, but cacls (or the newer and more advanced xcacls) is the
utility you're looking for.

just type cacls /? at any command prompt. You can do it via wmi, too, I
think. There are probably some examples in supplement four, which I can't
seem to locate right now... it was here somewhere... can anyone else here
find it? :)

Jeremy (buried in data)
jerm...@intersite.com.leftlung
(remove my leftlung to reply)

"Marty Henderson" <Mar...@pchcall.com> wrote in message
news:#BXhTUJ6AHA.1668@tkmsftngp07...

Jason Kohlhoff

未读,
2001年5月30日 00:54:532001/5/30
收件人
Try the *free* File Manager control from Soft Artisans, it allows modifying
ACLs and ownership among other things...
http://www.softartisans.com/softartisans/safilemanager.html

Online docs(and samples) are at:
http://support.softartisans.com/kbindex.asp

Jason

"Marty Henderson" <Mar...@pchcall.com> wrote in message
news:#BXhTUJ6AHA.1668@tkmsftngp07...

Matthew Summers

未读,
2001年5月30日 03:45:012001/5/30
收件人
Download the adsi sdk.
regsvr32.exe adssecurity.dll
and use the following code which comes with the sdk

Const ADS_RIGHT_GENERIC_READ = &H80000000
Const ADS_RIGHT_GENERIC_EXECUTE = &H20000000
Const ADS_ACETYPE_ACCESS_ALLOWED = 0

Set sec = CreateObject("ADsSecurity")

Set sd = sec.GetSecurityDescriptor("FILE://c:\files")
Set dacl = sd.DiscretionaryAcl

'-- Show the ACEs in the DACL ----
For Each ace In dacl
wscript.echo ace.Trustee
wscript.echo ace.AccessMask
wscript.echo ace.AceType
Next

Set ace = CreateObject("AccessControlEntry")
ace.Trustee = "BIGCATS\administrator"
ace.AccessMask = ADS_RIGHT_GENERIC_READ Or ADS_RIGHT_GENERIC_EXECUTE
ace.AceType = ADS_ACETYPE_ACCESS_ALLOWED

dacl.AddAce ace
sd.DiscretionaryAcl = dacl
sec.SetSecurityDescriptor sd

or you could use cacls.exe which comes with Win2k


Marty Henderson <Mar...@pchcall.com> wrote in message
news:#BXhTUJ6AHA.1668@tkmsftngp07...

Jeremy

未读,
2001年5月30日 15:46:482001/5/30
收件人
yes, cacls was in nt 4.0 as well.

I knew someone would have that ADsSecurity bit. There's an alternate way,
that works with nt 4 permissions as well. The poster didn't specify what
system they were working on...

Jeremy

"Matthew Summers" <msummersR...@mail.comNOSPAM> wrote in message
news:cw1R6.11999$Uo3.4...@news6.giganews.com...

0 个新帖子