By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,364 Members | 1,518 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,364 IT Pros & Developers. It's quick & easy.

Cannot run xcacls to modify user rights on a certain file?

P: n/a
Hi:

I am working in win 2003 and ASP.NET. I tried to modify the user rights from
an ASPX (writen in C#) page through running xcacls. But failed. What I did
is:

Process myProcess = new Process();

myProcess.StartInfo.FileName = "cmd.exe";

myProcess.StartInfo.Arguments = @"/C xcacls filename /T /E /G username:R;R
/Y";

myProcess.StartInfo.UseShellExecute=false;

myProcess.StartInfo.RedirectStandardOutput = true;

myProcess.StartInfo.CreateNoWindow = true ;

myProcess.Start();
However, it worked if only try to get the ACLs information:
myProcess.StartInfo.Arguments = @"/C xcacls filename /Y";

I think it might be caused by security setting of my system so that it did
not allow to change the security right.

Does anyone know where the problem is?

Thanks

Q.

Nov 18 '05 #1
Share this Question
Share on Google+
12 Replies


P: n/a
Under what user account context is your ASPX page running under? The
current account probably doesn't have sufficient rights.

Jeff

"Quentin Huo" <q.***@manyworlds.com> wrote in message
news:uz**************@TK2MSFTNGP14.phx.gbl...
Hi:

I am working in win 2003 and ASP.NET. I tried to modify the user rights from an ASPX (writen in C#) page through running xcacls. But failed. What I did
is:

Process myProcess = new Process();

myProcess.StartInfo.FileName = "cmd.exe";

myProcess.StartInfo.Arguments = @"/C xcacls filename /T /E /G username:R;R
/Y";

myProcess.StartInfo.UseShellExecute=false;

myProcess.StartInfo.RedirectStandardOutput = true;

myProcess.StartInfo.CreateNoWindow = true ;

myProcess.Start();
However, it worked if only try to get the ACLs information:
myProcess.StartInfo.Arguments = @"/C xcacls filename /Y";

I think it might be caused by security setting of my system so that it did
not allow to change the security right.

Does anyone know where the problem is?

Thanks

Q.

Nov 18 '05 #2

P: n/a
Does the NETWORK SERVICE have ownership of the file? Or does it have
the "Change permissions" permission?

You'll have to give these permissions to the NETWORK SERVICE account,
or run the worker process under an account with these permissions (or
use impersonation and Pinvoke Win32 API functions to make the change -
but that's not easy in 1.1). There are actually quite a number of
alternatives to get this working depending on what you need to do.

--
Scott
http://www.OdeToCode.com/blogs/scott/
On Thu, 18 Nov 2004 10:30:52 -0600, "Quentin Huo"
<q.***@manyworlds.com> wrote:
Hi:

I am working in win 2003 and ASP.NET. I tried to modify the user rights from
an ASPX (writen in C#) page through running xcacls. But failed. What I did
is:

Process myProcess = new Process();

myProcess.StartInfo.FileName = "cmd.exe";

myProcess.StartInfo.Arguments = @"/C xcacls filename /T /E /G username:R;R
/Y";

myProcess.StartInfo.UseShellExecute=false;

myProcess.StartInfo.RedirectStandardOutput = true;

myProcess.StartInfo.CreateNoWindow = true ;

myProcess.Start();
However, it worked if only try to get the ACLs information:
myProcess.StartInfo.Arguments = @"/C xcacls filename /Y";

I think it might be caused by security setting of my system so that it did
not allow to change the security right.

Does anyone know where the problem is?

Thanks

Q.


Nov 18 '05 #3

P: n/a
the user who login is in the group "administrators".
"Jeff Dillon" <je**@removeemergencyreporting.com> wrote in message
news:Od**************@TK2MSFTNGP09.phx.gbl...
Under what user account context is your ASPX page running under? The
current account probably doesn't have sufficient rights.

Jeff

"Quentin Huo" <q.***@manyworlds.com> wrote in message
news:uz**************@TK2MSFTNGP14.phx.gbl...
Hi:

I am working in win 2003 and ASP.NET. I tried to modify the user rights

from
an ASPX (writen in C#) page through running xcacls. But failed. What I
did
is:

Process myProcess = new Process();

myProcess.StartInfo.FileName = "cmd.exe";

myProcess.StartInfo.Arguments = @"/C xcacls filename /T /E /G
username:R;R
/Y";

myProcess.StartInfo.UseShellExecute=false;

myProcess.StartInfo.RedirectStandardOutput = true;

myProcess.StartInfo.CreateNoWindow = true ;

myProcess.Start();
However, it worked if only try to get the ACLs information:
myProcess.StartInfo.Arguments = @"/C xcacls filename /Y";

I think it might be caused by security setting of my system so that it
did
not allow to change the security right.

Does anyone know where the problem is?

Thanks

Q.


Nov 18 '05 #4

P: n/a
the NETWORK SERVICE account has only read right on thst directory.

Q.

"Scott Allen" <bitmask@[nospam].fred.net> wrote in message
news:ts********************************@4ax.com...
Does the NETWORK SERVICE have ownership of the file? Or does it have
the "Change permissions" permission?

You'll have to give these permissions to the NETWORK SERVICE account,
or run the worker process under an account with these permissions (or
use impersonation and Pinvoke Win32 API functions to make the change -
but that's not easy in 1.1). There are actually quite a number of
alternatives to get this working depending on what you need to do.

--
Scott
http://www.OdeToCode.com/blogs/scott/
On Thu, 18 Nov 2004 10:30:52 -0600, "Quentin Huo"
<q.***@manyworlds.com> wrote:
Hi:

I am working in win 2003 and ASP.NET. I tried to modify the user rights
from
an ASPX (writen in C#) page through running xcacls. But failed. What I did
is:

Process myProcess = new Process();

myProcess.StartInfo.FileName = "cmd.exe";

myProcess.StartInfo.Arguments = @"/C xcacls filename /T /E /G username:R;R
/Y";

myProcess.StartInfo.UseShellExecute=false;

myProcess.StartInfo.RedirectStandardOutput = true;

myProcess.StartInfo.CreateNoWindow = true ;

myProcess.Start();
However, it worked if only try to get the ACLs information:
myProcess.StartInfo.Arguments = @"/C xcacls filename /Y";

I think it might be caused by security setting of my system so that it did
not allow to change the security right.

Does anyone know where the problem is?

Thanks

Q.

Nov 18 '05 #5

P: n/a
OK, but the Process you launch will use the same security context as
the parent process, by default that is NETWORK SERVICE on Win2k3.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Thu, 18 Nov 2004 12:36:56 -0600, "Quentin Huo"
<q.***@manyworlds.com> wrote:
the user who login is in the group "administrators".
"Jeff Dillon" <je**@removeemergencyreporting.com> wrote in message
news:Od**************@TK2MSFTNGP09.phx.gbl...
Under what user account context is your ASPX page running under? The
current account probably doesn't have sufficient rights.

Jeff

"Quentin Huo" <q.***@manyworlds.com> wrote in message
news:uz**************@TK2MSFTNGP14.phx.gbl...
Hi:

I am working in win 2003 and ASP.NET. I tried to modify the user rights

from
an ASPX (writen in C#) page through running xcacls. But failed. What I
did
is:

Process myProcess = new Process();

myProcess.StartInfo.FileName = "cmd.exe";

myProcess.StartInfo.Arguments = @"/C xcacls filename /T /E /G
username:R;R
/Y";

myProcess.StartInfo.UseShellExecute=false;

myProcess.StartInfo.RedirectStandardOutput = true;

myProcess.StartInfo.CreateNoWindow = true ;

myProcess.Start();
However, it worked if only try to get the ACLs information:
myProcess.StartInfo.Arguments = @"/C xcacls filename /Y";

I think it might be caused by security setting of my system so that it
did
not allow to change the security right.

Does anyone know where the problem is?

Thanks

Q.



Nov 18 '05 #6

P: n/a
Then your process will not have permissions. You'll need to give the
account some additional permissions, if possible.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Thu, 18 Nov 2004 12:37:50 -0600, "Quentin Huo"
<q.***@manyworlds.com> wrote:
the NETWORK SERVICE account has only read right on thst directory.

Q.


Nov 18 '05 #7

P: n/a
Hi:

I just tried to give the NETWORK SERVICE account "modify" permission on its
working directory and its target directory, but it still doesn't work and no
any error message.

What I need to do is to create new directories and modify the user rights on
the new folders, from an aspx page.

Any better idea?

Thanks a lot!

Q.
"Scott Allen" <bitmask@[nospam].fred.net> wrote in message
news:ts********************************@4ax.com...
Does the NETWORK SERVICE have ownership of the file? Or does it have
the "Change permissions" permission?

You'll have to give these permissions to the NETWORK SERVICE account,
or run the worker process under an account with these permissions (or
use impersonation and Pinvoke Win32 API functions to make the change -
but that's not easy in 1.1). There are actually quite a number of
alternatives to get this working depending on what you need to do.

--
Scott
http://www.OdeToCode.com/blogs/scott/
On Thu, 18 Nov 2004 10:30:52 -0600, "Quentin Huo"
<q.***@manyworlds.com> wrote:
Hi:

I am working in win 2003 and ASP.NET. I tried to modify the user rights
from
an ASPX (writen in C#) page through running xcacls. But failed. What I did
is:

Process myProcess = new Process();

myProcess.StartInfo.FileName = "cmd.exe";

myProcess.StartInfo.Arguments = @"/C xcacls filename /T /E /G username:R;R
/Y";

myProcess.StartInfo.UseShellExecute=false;

myProcess.StartInfo.RedirectStandardOutput = true;

myProcess.StartInfo.CreateNoWindow = true ;

myProcess.Start();
However, it worked if only try to get the ACLs information:
myProcess.StartInfo.Arguments = @"/C xcacls filename /Y";

I think it might be caused by security setting of my system so that it did
not allow to change the security right.

Does anyone know where the problem is?

Thanks

Q.

Nov 18 '05 #8

P: n/a
Hi Quentin,

Go into the Advanced tab, highlight the Account, and click Edit.
You'll want to make sure "create folders" and "change permission" are
enabled.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Thu, 18 Nov 2004 12:50:34 -0600, "Quentin Huo"
<q.***@manyworlds.com> wrote:
Hi:

I just tried to give the NETWORK SERVICE account "modify" permission on its
working directory and its target directory, but it still doesn't work and no
any error message.

What I need to do is to create new directories and modify the user rights on
the new folders, from an aspx page.

Any better idea?

Thanks a lot!

Q.


Nov 18 '05 #9

P: n/a
Hi:

I just tried: failed, even I gave it full control on the directory. DO I
need to config other directory?

Thanks a lot!

Q.

"Scott Allen" <bitmask@[nospam].fred.net> wrote in message
news:is********************************@4ax.com...
Hi Quentin,

Go into the Advanced tab, highlight the Account, and click Edit.
You'll want to make sure "create folders" and "change permission" are
enabled.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Thu, 18 Nov 2004 12:50:34 -0600, "Quentin Huo"
<q.***@manyworlds.com> wrote:
Hi:

I just tried to give the NETWORK SERVICE account "modify" permission on
its
working directory and its target directory, but it still doesn't work and
no
any error message.

What I need to do is to create new directories and modify the user rights
on
the new folders, from an aspx page.

Any better idea?

Thanks a lot!

Q.

Nov 18 '05 #10

P: n/a
Hmm, that's odd. You may want to redirect standard output and either
to a file, or read StandardOutput with a StreamReader and see if the
process reports any errors (or perhaps it is not starting).

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Thu, 18 Nov 2004 14:08:29 -0600, "Quentin Huo"
<q.***@manyworlds.com> wrote:
Hi:

I just tried: failed, even I gave it full control on the directory. DO I
need to config other directory?

Thanks a lot!

Q.

"Scott Allen" <bitmask@[nospam].fred.net> wrote in message
news:is********************************@4ax.com.. .
Hi Quentin,

Go into the Advanced tab, highlight the Account, and click Edit.
You'll want to make sure "create folders" and "change permission" are
enabled.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Thu, 18 Nov 2004 12:50:34 -0600, "Quentin Huo"
<q.***@manyworlds.com> wrote:
Hi:

I just tried to give the NETWORK SERVICE account "modify" permission on
its
working directory and its target directory, but it still doesn't work and
no
any error message.

What I need to do is to create new directories and modify the user rights
on
the new folders, from an aspx page.

Any better idea?

Thanks a lot!

Q.


Nov 18 '05 #11

P: n/a
Give EVERYONE Full control, and go from there

Or run your ASPNET application under an admin account. Or add NETWORK SERVER
to admins..

I can think of many things I would try...

Jeff
"Quentin Huo" <q.***@manyworlds.com> wrote in message
news:#O*************@TK2MSFTNGP14.phx.gbl...
Hi:

I just tried: failed, even I gave it full control on the directory. DO I
need to config other directory?

Thanks a lot!

Q.

"Scott Allen" <bitmask@[nospam].fred.net> wrote in message
news:is********************************@4ax.com...
Hi Quentin,

Go into the Advanced tab, highlight the Account, and click Edit.
You'll want to make sure "create folders" and "change permission" are
enabled.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Thu, 18 Nov 2004 12:50:34 -0600, "Quentin Huo"
<q.***@manyworlds.com> wrote:
Hi:

I just tried to give the NETWORK SERVICE account "modify" permission on
its
working directory and its target directory, but it still doesn't work andno
any error message.

What I need to do is to create new directories and modify the user rightson
the new folders, from an aspx page.

Any better idea?

Thanks a lot!

Q.


Nov 18 '05 #12

P: n/a
Hi,

thank you very much!

Yesterday I made a mistake. In fact, after I gave the modify right to
NETWORK SERVICE account, it worked.

Thanks again.

Q.
"Scott Allen" <bitmask@[nospam].fred.net> wrote in message
news:oq********************************@4ax.com...
Hmm, that's odd. You may want to redirect standard output and either
to a file, or read StandardOutput with a StreamReader and see if the
process reports any errors (or perhaps it is not starting).

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Thu, 18 Nov 2004 14:08:29 -0600, "Quentin Huo"
<q.***@manyworlds.com> wrote:
Hi:

I just tried: failed, even I gave it full control on the directory. DO I
need to config other directory?

Thanks a lot!

Q.

"Scott Allen" <bitmask@[nospam].fred.net> wrote in message
news:is********************************@4ax.com. ..
Hi Quentin,

Go into the Advanced tab, highlight the Account, and click Edit.
You'll want to make sure "create folders" and "change permission" are
enabled.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Thu, 18 Nov 2004 12:50:34 -0600, "Quentin Huo"
<q.***@manyworlds.com> wrote:

Hi:

I just tried to give the NETWORK SERVICE account "modify" permission on
its
working directory and its target directory, but it still doesn't work
and
no
any error message.

What I need to do is to create new directories and modify the user
rights
on
the new folders, from an aspx page.

Any better idea?

Thanks a lot!

Q.

Nov 18 '05 #13

This discussion thread is closed

Replies have been disabled for this discussion.