I am working in a domain environment. I am on a client machine and
wants to edit registery of domain server. I am currently in a Domain
user account and member of Domain administrators on the domain
controller. I am able to open registry manully by connecting the remote
registry. While doing the same programatically i am getting the
following exception :
CODE :
RegistryKey baseKey =
RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMa chine, "server");
RegistryKey sk1 =
baseKey.OpenSubKey(@"SYSTEM\CurrentControlSet\Serv ices\EXIFS\Parameters");
string key = "incoming";
sk1.CreateSubKey(key);
sk1.SetValue(key, 1, RegistryValueKind.DWord);
EXCEPTION:
System.UnauthorizedAccessException was unhandled
Message="Cannot write to the registry key."
Source="mscorlib"
StackTrace:
at
System.ThrowHelper.ThrowUnauthorizedAccessExceptio n(ExceptionResource
resource)
at Microsoft.Win32.RegistryKey.CreateSubKey(String subkey,
RegistryKeyPermissionCheck permissionCheck, RegistrySecurity
registrySecurity)
at Microsoft.Win32.RegistryKey.CreateSubKey(String subkey)
at MyEventSink.ExchangeConnect.SendMessage.Main(Strin g[] srgs)
in D:\Parv\Data\Visual
Basic\MyEventSink\ExchangeConnect\SendMessage.cs:l ine 53
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[]
args)
at System.Runtime.Hosting.ManifestRunner.Run(Boolean
checkAptModel)
at System.Runtime.Hosting.ManifestRunner.ExecuteAsAss embly()
at
System.Runtime.Hosting.ApplicationActivator.Create Instance(ActivationContext
activationContext, String[] activationCustomData)
at
System.Runtime.Hosting.ApplicationActivator.Create Instance(ActivationContext
activationContext)
at
Microsoft.VisualStudio.HostingProcess.HostProc.Run UsersAssemblyDebugInZone()
at System.Threading.ThreadHelper.ThreadStart_Context( Object
state)
at System.Threading.ExecutionContext.Run(ExecutionCon text
executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
What i am doing wrong ?
Thanx in advance.
With Best Regards
Parveen Beniwal 5 7842
Are you sure the code runs as domain admin?
To make sure, turn on security auditing on the DC and watch the security
eventlog, this should contain a message specifying the account that failed
to access the registry object.
Willy.
"Parv" <Pa**********************@gmail.comwrote in message
news:11*********************@m73g2000cwd.googlegro ups.com...
|I am working in a domain environment. I am on a client machine and
| wants to edit registery of domain server. I am currently in a Domain
| user account and member of Domain administrators on the domain
| controller. I am able to open registry manully by connecting the remote
| registry. While doing the same programatically i am getting the
| following exception :
|
| CODE :
|
| RegistryKey baseKey =
| RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMa chine, "server");
|
| RegistryKey sk1 =
| baseKey.OpenSubKey(@"SYSTEM\CurrentControlSet\Serv ices\EXIFS\Parameters");
| string key = "incoming";
| sk1.CreateSubKey(key);
| sk1.SetValue(key, 1, RegistryValueKind.DWord);
|
| EXCEPTION:
|
| System.UnauthorizedAccessException was unhandled
| Message="Cannot write to the registry key."
| Source="mscorlib"
| StackTrace:
| at
| System.ThrowHelper.ThrowUnauthorizedAccessExceptio n(ExceptionResource
| resource)
| at Microsoft.Win32.RegistryKey.CreateSubKey(String subkey,
| RegistryKeyPermissionCheck permissionCheck, RegistrySecurity
| registrySecurity)
| at Microsoft.Win32.RegistryKey.CreateSubKey(String subkey)
| at MyEventSink.ExchangeConnect.SendMessage.Main(Strin g[] srgs)
| in D:\Parv\Data\Visual
| Basic\MyEventSink\ExchangeConnect\SendMessage.cs:l ine 53
| at System.AppDomain.nExecuteAssembly(Assembly assembly, String[]
| args)
| at System.Runtime.Hosting.ManifestRunner.Run(Boolean
| checkAptModel)
| at System.Runtime.Hosting.ManifestRunner.ExecuteAsAss embly()
| at
|
System.Runtime.Hosting.ApplicationActivator.Create Instance(ActivationContext
| activationContext, String[] activationCustomData)
| at
|
System.Runtime.Hosting.ApplicationActivator.Create Instance(ActivationContext
| activationContext)
| at
|
Microsoft.VisualStudio.HostingProcess.HostProc.Run UsersAssemblyDebugInZone()
| at System.Threading.ThreadHelper.ThreadStart_Context( Object
| state)
| at System.Threading.ExecutionContext.Run(ExecutionCon text
| executionContext, ContextCallback callback, Object state)
| at System.Threading.ThreadHelper.ThreadStart()
|
| What i am doing wrong ?
|
| Thanx in advance.
|
| With Best Regards
| Parveen Beniwal
|
thanx, i have tried this but there is no security log for my Login
attempt on the DC. One more thing same is happenning when i am
attempting to edit my own system's registry. And on my system too there
is no log for login attempt.
With Best Regards
Parveen Beniwal
Willy Denoyette [MVP] wrote:
Are you sure the code runs as domain admin?
To make sure, turn on security auditing on the DC and watch the security
eventlog, this should contain a message specifying the account that failed
to access the registry object.
Willy.
"Parv" <Pa**********************@gmail.comwrote in message
news:11*********************@m73g2000cwd.googlegro ups.com...
|I am working in a domain environment. I am on a client machine and
| wants to edit registery of domain server. I am currently in a Domain
| user account and member of Domain administrators on the domain
| controller. I am able to open registry manully by connecting the remote
| registry. While doing the same programatically i am getting the
| following exception :
|
| CODE :
|
| RegistryKey baseKey =
| RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMa chine, "server");
|
| RegistryKey sk1 =
| baseKey.OpenSubKey(@"SYSTEM\CurrentControlSet\Serv ices\EXIFS\Parameters");
| string key = "incoming";
| sk1.CreateSubKey(key);
| sk1.SetValue(key, 1, RegistryValueKind.DWord);
|
| EXCEPTION:
|
| System.UnauthorizedAccessException was unhandled
| Message="Cannot write to the registry key."
| Source="mscorlib"
| StackTrace:
| at
| System.ThrowHelper.ThrowUnauthorizedAccessExceptio n(ExceptionResource
| resource)
| at Microsoft.Win32.RegistryKey.CreateSubKey(String subkey,
| RegistryKeyPermissionCheck permissionCheck, RegistrySecurity
| registrySecurity)
| at Microsoft.Win32.RegistryKey.CreateSubKey(String subkey)
| at MyEventSink.ExchangeConnect.SendMessage.Main(Strin g[] srgs)
| in D:\Parv\Data\Visual
| Basic\MyEventSink\ExchangeConnect\SendMessage.cs:l ine 53
| at System.AppDomain.nExecuteAssembly(Assembly assembly, String[]
| args)
| at System.Runtime.Hosting.ManifestRunner.Run(Boolean
| checkAptModel)
| at System.Runtime.Hosting.ManifestRunner.ExecuteAsAss embly()
| at
|
System.Runtime.Hosting.ApplicationActivator.Create Instance(ActivationContext
| activationContext, String[] activationCustomData)
| at
|
System.Runtime.Hosting.ApplicationActivator.Create Instance(ActivationContext
| activationContext)
| at
|
Microsoft.VisualStudio.HostingProcess.HostProc.Run UsersAssemblyDebugInZone()
| at System.Threading.ThreadHelper.ThreadStart_Context( Object
| state)
| at System.Threading.ExecutionContext.Run(ExecutionCon text
| executionContext, ContextCallback callback, Object state)
| at System.Threading.ThreadHelper.ThreadStart()
|
| What i am doing wrong ?
|
| Thanx in advance.
|
| With Best Regards
| Parveen Beniwal
|
Please be more specific, what's your own system and what account are you
running under?
Willy.
"Parv" <Pa**********************@gmail.comwrote in message
news:11**********************@74g2000cwt.googlegro ups.com...
| thanx, i have tried this but there is no security log for my Login
| attempt on the DC. One more thing same is happenning when i am
| attempting to edit my own system's registry. And on my system too there
| is no log for login attempt.
|
| With Best Regards
| Parveen Beniwal
| Willy Denoyette [MVP] wrote:
| Are you sure the code runs as domain admin?
| To make sure, turn on security auditing on the DC and watch the security
| eventlog, this should contain a message specifying the account that
failed
| to access the registry object.
| >
| Willy.
| >
| "Parv" <Pa**********************@gmail.comwrote in message
| news:11*********************@m73g2000cwd.googlegro ups.com...
| |I am working in a domain environment. I am on a client machine and
| | wants to edit registery of domain server. I am currently in a Domain
| | user account and member of Domain administrators on the domain
| | controller. I am able to open registry manully by connecting the
remote
| | registry. While doing the same programatically i am getting the
| | following exception :
| |
| | CODE :
| |
| | RegistryKey baseKey =
| | RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMa chine, "server");
| |
| | RegistryKey sk1 =
| |
baseKey.OpenSubKey(@"SYSTEM\CurrentControlSet\Serv ices\EXIFS\Parameters");
| | string key = "incoming";
| | sk1.CreateSubKey(key);
| | sk1.SetValue(key, 1, RegistryValueKind.DWord);
| |
| | EXCEPTION:
| |
| | System.UnauthorizedAccessException was unhandled
| | Message="Cannot write to the registry key."
| | Source="mscorlib"
| | StackTrace:
| | at
| | System.ThrowHelper.ThrowUnauthorizedAccessExceptio n(ExceptionResource
| | resource)
| | at Microsoft.Win32.RegistryKey.CreateSubKey(String subkey,
| | RegistryKeyPermissionCheck permissionCheck, RegistrySecurity
| | registrySecurity)
| | at Microsoft.Win32.RegistryKey.CreateSubKey(String subkey)
| | at MyEventSink.ExchangeConnect.SendMessage.Main(Strin g[] srgs)
| | in D:\Parv\Data\Visual
| | Basic\MyEventSink\ExchangeConnect\SendMessage.cs:l ine 53
| | at System.AppDomain.nExecuteAssembly(Assembly assembly, String[]
| | args)
| | at System.Runtime.Hosting.ManifestRunner.Run(Boolean
| | checkAptModel)
| | at System.Runtime.Hosting.ManifestRunner.ExecuteAsAss embly()
| | at
| |
| >
System.Runtime.Hosting.ApplicationActivator.Create Instance(ActivationContext
| | activationContext, String[] activationCustomData)
| | at
| |
| >
System.Runtime.Hosting.ApplicationActivator.Create Instance(ActivationContext
| | activationContext)
| | at
| |
| >
Microsoft.VisualStudio.HostingProcess.HostProc.Run UsersAssemblyDebugInZone()
| | at System.Threading.ThreadHelper.ThreadStart_Context( Object
| | state)
| | at System.Threading.ExecutionContext.Run(ExecutionCon text
| | executionContext, ContextCallback callback, Object state)
| | at System.Threading.ThreadHelper.ThreadStart()
| |
| | What i am doing wrong ?
| |
| | Thanx in advance.
| |
| | With Best Regards
| | Parveen Beniwal
| |
|
ok, let me elaborate my case again.Actually i m working on a windows
2000 professional client system and working in a 2000 Advanced server
Domain environment. And i am using my own user account as
parveen.beniwal which is member of Domain admins and Administrator on
the Domain Controller. Now i want to update registry of my domain
controller from my client computer. I am able to do this manually but
programatically. Please help..
With Best Regards
Parveen Beniwal
Willy Denoyette [MVP] wrote:
Please be more specific, what's your own system and what account are you
running under?
Willy.
"Parv" <Pa**********************@gmail.comwrote in message
news:11**********************@74g2000cwt.googlegro ups.com...
| thanx, i have tried this but there is no security log for my Login
| attempt on the DC. One more thing same is happenning when i am
| attempting to edit my own system's registry. And on my system too there
| is no log for login attempt.
|
| With Best Regards
| Parveen Beniwal
| Willy Denoyette [MVP] wrote:
| Are you sure the code runs as domain admin?
| To make sure, turn on security auditing on the DC and watch the security
| eventlog, this should contain a message specifying the account that
failed
| to access the registry object.
| >
| Willy.
| >
| "Parv" <Pa**********************@gmail.comwrote in message
| news:11*********************@m73g2000cwd.googlegro ups.com...
| |I am working in a domain environment. I am on a client machine and
| | wants to edit registery of domain server. I am currently in a Domain
| | user account and member of Domain administrators on the domain
| | controller. I am able to open registry manully by connecting the
remote
| | registry. While doing the same programatically i am getting the
| | following exception :
| |
| | CODE :
| |
| | RegistryKey baseKey =
| | RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMa chine, "server");
| |
| | RegistryKey sk1 =
| |
baseKey.OpenSubKey(@"SYSTEM\CurrentControlSet\Serv ices\EXIFS\Parameters");
| | string key = "incoming";
| | sk1.CreateSubKey(key);
| | sk1.SetValue(key, 1, RegistryValueKind.DWord);
| |
| | EXCEPTION:
| |
| | System.UnauthorizedAccessException was unhandled
| | Message="Cannot write to the registry key."
| | Source="mscorlib"
| | StackTrace:
| | at
| | System.ThrowHelper.ThrowUnauthorizedAccessExceptio n(ExceptionResource
| | resource)
| | at Microsoft.Win32.RegistryKey.CreateSubKey(String subkey,
| | RegistryKeyPermissionCheck permissionCheck, RegistrySecurity
| | registrySecurity)
| | at Microsoft.Win32.RegistryKey.CreateSubKey(String subkey)
| | at MyEventSink.ExchangeConnect.SendMessage.Main(Strin g[] srgs)
| | in D:\Parv\Data\Visual
| | Basic\MyEventSink\ExchangeConnect\SendMessage.cs:l ine 53
| | at System.AppDomain.nExecuteAssembly(Assembly assembly, String[]
| | args)
| | at System.Runtime.Hosting.ManifestRunner.Run(Boolean
| | checkAptModel)
| | at System.Runtime.Hosting.ManifestRunner.ExecuteAsAss embly()
| | at
| |
| >
System.Runtime.Hosting.ApplicationActivator.Create Instance(ActivationContext
| | activationContext, String[] activationCustomData)
| | at
| |
| >
System.Runtime.Hosting.ApplicationActivator.Create Instance(ActivationContext
| | activationContext)
| | at
| |
| >
Microsoft.VisualStudio.HostingProcess.HostProc.Run UsersAssemblyDebugInZone()
| | at System.Threading.ThreadHelper.ThreadStart_Context( Object
| | state)
| | at System.Threading.ExecutionContext.Run(ExecutionCon text
| | executionContext, ContextCallback callback, Object state)
| | at System.Threading.ThreadHelper.ThreadStart()
| |
| | What i am doing wrong ?
| |
| | Thanx in advance.
| |
| | With Best Regards
| | Parveen Beniwal
| |
|
Sorry if I wasn't clear, but you have to enable "registry object access"
auditing, that is from regedit select the key you want to audit and add the
user or group you want to monitor. Then, using "Local Security Policy"
editor, you must turn-on; Local Policies - Audit Policy - Audit Object
Access for Failure. When done, each unsuccessful access will be logged in
security log and will contain the account used to modify a key or subkey.
Willy.
"Parv" <Pa**********************@gmail.comwrote in message
news:11**********************@74g2000cwt.googlegro ups.com...
| thanx, i have tried this but there is no security log for my Login
| attempt on the DC. One more thing same is happenning when i am
| attempting to edit my own system's registry. And on my system too there
| is no log for login attempt.
|
| With Best Regards
| Parveen Beniwal
| Willy Denoyette [MVP] wrote:
| Are you sure the code runs as domain admin?
| To make sure, turn on security auditing on the DC and watch the security
| eventlog, this should contain a message specifying the account that
failed
| to access the registry object.
| >
| Willy.
| >
| "Parv" <Pa**********************@gmail.comwrote in message
| news:11*********************@m73g2000cwd.googlegro ups.com...
| |I am working in a domain environment. I am on a client machine and
| | wants to edit registery of domain server. I am currently in a Domain
| | user account and member of Domain administrators on the domain
| | controller. I am able to open registry manully by connecting the
remote
| | registry. While doing the same programatically i am getting the
| | following exception :
| |
| | CODE :
| |
| | RegistryKey baseKey =
| | RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMa chine, "server");
| |
| | RegistryKey sk1 =
| |
baseKey.OpenSubKey(@"SYSTEM\CurrentControlSet\Serv ices\EXIFS\Parameters");
| | string key = "incoming";
| | sk1.CreateSubKey(key);
| | sk1.SetValue(key, 1, RegistryValueKind.DWord);
| |
| | EXCEPTION:
| |
| | System.UnauthorizedAccessException was unhandled
| | Message="Cannot write to the registry key."
| | Source="mscorlib"
| | StackTrace:
| | at
| | System.ThrowHelper.ThrowUnauthorizedAccessExceptio n(ExceptionResource
| | resource)
| | at Microsoft.Win32.RegistryKey.CreateSubKey(String subkey,
| | RegistryKeyPermissionCheck permissionCheck, RegistrySecurity
| | registrySecurity)
| | at Microsoft.Win32.RegistryKey.CreateSubKey(String subkey)
| | at MyEventSink.ExchangeConnect.SendMessage.Main(Strin g[] srgs)
| | in D:\Parv\Data\Visual
| | Basic\MyEventSink\ExchangeConnect\SendMessage.cs:l ine 53
| | at System.AppDomain.nExecuteAssembly(Assembly assembly, String[]
| | args)
| | at System.Runtime.Hosting.ManifestRunner.Run(Boolean
| | checkAptModel)
| | at System.Runtime.Hosting.ManifestRunner.ExecuteAsAss embly()
| | at
| |
| >
System.Runtime.Hosting.ApplicationActivator.Create Instance(ActivationContext
| | activationContext, String[] activationCustomData)
| | at
| |
| >
System.Runtime.Hosting.ApplicationActivator.Create Instance(ActivationContext
| | activationContext)
| | at
| |
| >
Microsoft.VisualStudio.HostingProcess.HostProc.Run UsersAssemblyDebugInZone()
| | at System.Threading.ThreadHelper.ThreadStart_Context( Object
| | state)
| | at System.Threading.ExecutionContext.Run(ExecutionCon text
| | executionContext, ContextCallback callback, Object state)
| | at System.Threading.ThreadHelper.ThreadStart()
| |
| | What i am doing wrong ?
| |
| | Thanx in advance.
| |
| | With Best Regards
| | Parveen Beniwal
| |
| This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Slimo |
last post by:
Hello,
I'm searching some example of code (VB) for reading remote registry subkeys
and keys.
Thanks
|
by: Anton Sokolovsky |
last post by:
Hello All,
Please help. I am completely stuck. Any suggestions are very welcomed.
I have ASP.NET application that impersonates certain user
<impersonate="true" userName="registry:..."...
|
by: Steve Montgomery |
last post by:
Does anyone have a sample block of code they can share for checking a
DWORD value on a remote network machine's registry? For example, to
validate a patch deployment.
MSDN has a great sample for...
|
by: JJG |
last post by:
Hello. I'm not sure if this is the right forum, so please let me know what
is the correct one if it isn't. (I posted this one also to the
win32.programmer.wmi forum).
I've been puzzled by this...
|
by: Geoff McElhanon |
last post by:
I have been struggling with a security issue that occurs under .NET
2.0, but does not occur under .NET 1.1. Essentially I am trying to
open up a performance counter on a remote server and monitor...
|
by: Sin Jeong-hun |
last post by:
I need to read some registry keys of a remote computer. The key will
be any key users provide. (For example : HKEY_CURRENT_USER\SOFTWARE
\MyGame) I found that there was a handy method called...
|
by: =?Utf-8?B?YXVsZGg=?= |
last post by:
i current have a way to read both local and remote machines registry keys and
create a textual view (.txt output).
i now looking for ways to do export of local and remote mahcine registry
keys...
|
by: Kerem Gümrükcü |
last post by:
Hi,
is it possible to get the Information that comes from OperatingSystem Class
from a Remote Comupter. Is there a remote information supporting
OperatingSystem
Class or can i get this...
|
by: tlhintoq |
last post by:
I pride myself on being able to Google just about anything but...
I have fought, tried, searched and fought some more on this one.
I am using VMware, and am able to debug from Visual Studio to...
|
by: Kemmylinns12 |
last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
|
by: antdb |
last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine
In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
|
by: Matthew3360 |
last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function.
Here is my code.
header("Location:".$urlback);
Is this the right layout the...
|
by: Matthew3360 |
last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it so the python app could use a http request to get...
|
by: AndyPSV |
last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
|
by: WisdomUfot |
last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
|
by: Matthew3360 |
last post by:
Hi,
I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
|
by: Oralloy |
last post by:
Hello Folks,
I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA.
My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
|
by: Ricardo de Mila |
last post by:
Dear people, good afternoon...
I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control.
Than I need to discover what...
| |