Page 1 of 1 1
Topic Options
#197026 - 2009-12-08 07:48 PM NTFSPerms() fails to set the permissions.
jadewith Offline
Fresh Scripter

Registered: 2003-06-13
Posts: 45
Loc: Good ole U S of A
I am logged into a Windows XP pro sp2 system with a domain account that has admin permissions on the domain as well as the machine. I am attempting to add change permissions to an existing directory, and I keep getting the following error:

@error = -2147352567
@serror= com exception error "SetSecurityDescriptor" ((null) - (null)) [- 2147352567/80020009]

here's my code:

 Code:
$SO=SetOption('wrapateol','on')

$curuser='MyDomain\billy'
$IBM = 'c:\program files\E!PC\'


$rc=ntfsperms('ADD:Change',$ibm,$curuser)

?@ERROR
?@SERROR

 


Thanks for your help!

Top
#197034 - 2009-12-09 08:40 AM Re: NTFSPerms() fails to set the permissions. [Re: jadewith]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
Well, it can be two things;
1. You don't have Local Admin Permissions afterall.
2. It refuses to lookup the path because of the Exclamation Point.

Could you try:
 Code:
NTFSPerms("SHOW:Owner",$ibm)


And see what it returns ?
If that returns correctly, try removing the trailing backslash in the path.

Top
#197061 - 2009-12-10 06:20 AM Re: NTFSPerms() fails to set the permissions. [Re: Arend_]
jadewith Offline
Fresh Scripter

Registered: 2003-06-13
Posts: 45
Loc: Good ole U S of A
Thanks for the reply Apronk,

1. I thought of that, but since I can manually make the change to the directory, my user MUST have the proper permissions... right?

2. I have tried other folders in the program files directory with the same result.

thirdly, all the show commands work properly.

Funny thing is using the same code I can change the var to $IBM = 'c:\documents and settings\ a different users directory \ and
@error=0
@serror= the command completed successfully

I really don't get it.

Top
#197068 - 2009-12-10 08:23 PM Re: NTFSPerms() fails to set the permissions. [Re: jadewith]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
If all root folders of the Program Files folder do not work.
I would say that this is a security protocol set by a Group Policy.
Or still no proper permissions.

Please try to log in as the actual local Administrator and then try your script. That would verify you have enough rights.

The "Documents and Settings" directory have different rights assigned, and even then Group Policy might have changed those too.

So please try it once more as the Local Administrator of that computer and see what happens. I'm quite sure that is it.

Top
Page 1 of 1 1


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

Who's Online
0 registered and 302 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.102 seconds in which 0.075 seconds were spent on a total of 13 queries. Zlib compression enabled.

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