Page 1 of 1 1
Topic Options
#36673 - 2003-02-19 08:01 PM Permissions for a folder
cmarti Offline
Hey THIS is FUN

Registered: 2001-02-26
Posts: 297
Loc: Little Rock, AR
Is there a way to pull permissions from a folder using wsh or vbscripting somehow? I already know about cacls, xcacls, and dumpsec. Neither of them give me what I'm trying to accomplish..

Thanks in advance..

Top
#36674 - 2003-02-19 08:08 PM Re: Permissions for a folder
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
I can dump them with Perl. Would a standalone EXE serve your need? Not sure if I can write it within your desired timeframe though.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#36675 - 2003-02-19 08:11 PM Re: Permissions for a folder
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
before I start scrolling the board, my memory and MSDN... I must ask you, could you specify more what you actually need?
_________________________
!

download KiXnet

Top
#36676 - 2003-02-19 08:11 PM Re: Permissions for a folder
cmarti Offline
Hey THIS is FUN

Registered: 2001-02-26
Posts: 297
Loc: Little Rock, AR
Thanks for the quick reply. I'd actually like to know how to do it through kix by using a getobject, if that's possible..
Top
#36677 - 2003-02-19 08:14 PM Re: Permissions for a folder
cmarti Offline
Hey THIS is FUN

Registered: 2001-02-26
Posts: 297
Loc: Little Rock, AR
We have a share on one of our servers, inside of this share is a lot of directories that are owned by users. I'd like to create a report with the directory owner, which is actually a user group that always has -security at the end of it. I would like to:
1 get the owners of the directories in a file,
2 parse through it with kix finding the -security group for each folder
3 and write it to a separate file

I can do 2, and 3 but not 1.... [Frown]

I've already did a search on the board...

[ 19. February 2003, 20:15: Message edited by: cmarti ]

Top
#36678 - 2003-02-19 08:33 PM Re: Permissions for a folder
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
not sure about this.
as it's quickly translated from some foreign scripting language...

try this and tell does it meet the needs.
if yes, it should meet someone to write it as UDF...

code:
$objShell = CreateObject ("Shell.Application")
$objFolder = objShell.Namespace ("C:\Scripts")
$objFSO = CreateObject("Scripting.FileSystemObject")
Dim $arrHeaders[13]
For $i = 0 to 13
$arrHeaders[$i] = $objFolder.GetDetailsOf ($objFolder.Items, $i)
Next
For Each $strFileName in $objFolder.Items
For $i = 0 to 13
If $i <> 9
$arrHeaders[$i]+": "+$objFolder.GetDetailsOf ($strFileName, $i)
EndIf
Next
Next

_________________________
!

download KiXnet

Top
#36679 - 2003-02-19 08:42 PM Re: Permissions for a folder
cmarti Offline
Hey THIS is FUN

Registered: 2001-02-26
Posts: 297
Loc: Little Rock, AR
Here's what I get when I run it as a .vbs script.
code:
   D:\test.vbs(1, 1) Microsoft VBScript compilation error: Invalid character

Here's what I get when I run as a kix script.
code:
  
ERROR : unexpected command!
Script: D:\test2.SCR
Line : 6


Top
#36680 - 2003-02-19 08:47 PM Re: Permissions for a folder
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
ok, it was translated from:
http://www.microsoft.com/technet/treeview/default.asp?url=/technet/scriptcenter/filefolder/ScrFF63.asp

it should be better to do with shell-object alone and leaving wsh out of it... but too much in hurry now.

but, like used to any M$ documentation, you always have something to solve by yourself.
_________________________
!

download KiXnet

Top
#36681 - 2003-02-19 08:49 PM Re: Permissions for a folder
cmarti Offline
Hey THIS is FUN

Registered: 2001-02-26
Posts: 297
Loc: Little Rock, AR
ok...thanks....
Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 764 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.061 seconds in which 0.027 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org