I've been looking and trying for hours and haven't been able to figure out
how to read/write on the registry of a remote-computer with alternate
credentials. I've can do it easily on a local computer but not remotely.
I'm trying to convert my vbscripts to a vb.net program, though I'm thinking
of staying with my scripts after trying to figure this out :)
Any help would be greatly appreciated, here is the piece of VbScript code:
SET LOCATOR = CREATEOBJECT("WBEMSCRIPTING.SWBEMLOCATOR")
SET REGISTRY_SERVICE = LOCATOR.CONNECTSERVER(TARGET, "ROOT\DEFAULT",
ADMUSR, ADMPWD)
REGISTRY_SERVICE.SECURITY_.IMPERSONATIONLEVEL = 3
SET REGISTRY = REGISTRY_SERVICE.GET("STDREGPROV")
REGISTRY.GETSTRINGVALUE &H80000001,
"SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\EXPLORE R\SHELL FOLDERS\", "LOCAL
SETTINGS", LOCAL_SETTINGS 5 3419
Hi, http://msdn.microsoft.com/library/de...sekeytopic.asp
Ken
-------------------
"Rob Boger" <rb****@usa.com> wrote in message
news:OH****************@TK2MSFTNGP10.phx.gbl... I've been looking and trying for hours and haven't been able to figure out how to read/write on the registry of a remote-computer with alternate credentials. I've can do it easily on a local computer but not remotely.
I'm trying to convert my vbscripts to a vb.net program, though I'm
thinking of staying with my scripts after trying to figure this out :)
Any help would be greatly appreciated, here is the piece of VbScript code:
SET LOCATOR = CREATEOBJECT("WBEMSCRIPTING.SWBEMLOCATOR") SET REGISTRY_SERVICE = LOCATOR.CONNECTSERVER(TARGET, "ROOT\DEFAULT", ADMUSR, ADMPWD) REGISTRY_SERVICE.SECURITY_.IMPERSONATIONLEVEL = 3 SET REGISTRY = REGISTRY_SERVICE.GET("STDREGPROV") REGISTRY.GETSTRINGVALUE &H80000001, "SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\EXPLORE R\SHELL FOLDERS\",
"LOCAL SETTINGS", LOCAL_SETTINGS
Thanks Ken,
Unfortunately I'm not very bright but looking over that example, I'm not
quite sure where or how I can input specific credentials to use. In my work
environment, we log in with our regular NT accounts, but we also have an
domain admin account that we use for doing things like modifying the
registry on a remote computer, etc. So even though I run the application on
my system, it is under my normal account, not my domain admin account. I
guess once the application is done, I could do a 'runas' to open it up, but
would prefer to be able to specify a username and password.
Am I missing something in that code?
I really appreciate your response, sorry if the above is a little
incoherent, I've been up way too long :)
Rob
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:ub**************@TK2MSFTNGP10.phx.gbl... Hi,
http://msdn.microsoft.com/library/de...sekeytopic.asp Ken ------------------- "Rob Boger" <rb****@usa.com> wrote in message news:OH****************@TK2MSFTNGP10.phx.gbl... I've been looking and trying for hours and haven't been able to figure
out how to read/write on the registry of a remote-computer with alternate credentials. I've can do it easily on a local computer but not
remotely. I'm trying to convert my vbscripts to a vb.net program, though I'm thinking of staying with my scripts after trying to figure this out :)
Any help would be greatly appreciated, here is the piece of VbScript
code: SET LOCATOR = CREATEOBJECT("WBEMSCRIPTING.SWBEMLOCATOR") SET REGISTRY_SERVICE = LOCATOR.CONNECTSERVER(TARGET, "ROOT\DEFAULT", ADMUSR, ADMPWD) REGISTRY_SERVICE.SECURITY_.IMPERSONATIONLEVEL = 3 SET REGISTRY = REGISTRY_SERVICE.GET("STDREGPROV") REGISTRY.GETSTRINGVALUE &H80000001, "SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\EXPLORE R\SHELL FOLDERS\", "LOCAL SETTINGS", LOCAL_SETTINGS
Hi,
The line I wanted you to see is The remote computer must be running
the remote registry service.
Ken
---------------
"Rob Boger" <rb****@usa.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl... Thanks Ken,
Unfortunately I'm not very bright but looking over that example, I'm not quite sure where or how I can input specific credentials to use. In my
work environment, we log in with our regular NT accounts, but we also have an domain admin account that we use for doing things like modifying the registry on a remote computer, etc. So even though I run the application
on my system, it is under my normal account, not my domain admin account. I guess once the application is done, I could do a 'runas' to open it up,
but would prefer to be able to specify a username and password.
Am I missing something in that code?
I really appreciate your response, sorry if the above is a little incoherent, I've been up way too long :) Rob
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message news:ub**************@TK2MSFTNGP10.phx.gbl... Hi,
http://msdn.microsoft.com/library/de...sekeytopic.asp Ken ------------------- "Rob Boger" <rb****@usa.com> wrote in message news:OH****************@TK2MSFTNGP10.phx.gbl... I've been looking and trying for hours and haven't been able to figure out how to read/write on the registry of a remote-computer with alternate credentials. I've can do it easily on a local computer but not remotely. I'm trying to convert my vbscripts to a vb.net program, though I'm thinking of staying with my scripts after trying to figure this out :)
Any help would be greatly appreciated, here is the piece of VbScript code: SET LOCATOR = CREATEOBJECT("WBEMSCRIPTING.SWBEMLOCATOR") SET REGISTRY_SERVICE = LOCATOR.CONNECTSERVER(TARGET, "ROOT\DEFAULT", ADMUSR, ADMPWD) REGISTRY_SERVICE.SECURITY_.IMPERSONATIONLEVEL = 3 SET REGISTRY = REGISTRY_SERVICE.GET("STDREGPROV") REGISTRY.GETSTRINGVALUE &H80000001, "SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\EXPLORE R\SHELL FOLDERS\", "LOCAL SETTINGS", LOCAL_SETTINGS
* "Rob Boger" <rb****@usa.com> scripsit: I've been looking and trying for hours and haven't been able to figure out how to read/write on the registry of a remote-computer with alternate credentials. I've can do it easily on a local computer but not remotely.
I'm trying to convert my vbscripts to a vb.net program, though I'm thinking of staying with my scripts after trying to figure this out :)
Any help would be greatly appreciated, here is the piece of VbScript code:
SET LOCATOR = CREATEOBJECT("WBEMSCRIPTING.SWBEMLOCATOR") SET REGISTRY_SERVICE = LOCATOR.CONNECTSERVER(TARGET, "ROOT\DEFAULT", ADMUSR, ADMPWD) REGISTRY_SERVICE.SECURITY_.IMPERSONATIONLEVEL = 3 SET REGISTRY = REGISTRY_SERVICE.GET("STDREGPROV") REGISTRY.GETSTRINGVALUE &H80000001, "SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\EXPLORE R\SHELL FOLDERS\", "LOCAL SETTINGS", LOCAL_SETTINGS
Remove the 'Set's, then try to use the code in VB.NET. Enclose the
parameter list of 'GetStringValue' into '(', ')'.
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Thanks so much, this did the trick!
Thanks again,
Rob
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl... Remove the 'Set's, then try to use the code in VB.NET. Enclose the parameter list of 'GetStringValue' into '(', ')'. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Rohit Santhanam |
last post by:
As I am reading the .NET documentation, I get the feeling
that Microsoft is trying to get rid of the registry. My
understanding is that an application built using .NET
does not use the registry...
|
by: vincemoon |
last post by:
Below is an excerpt from my Registry Log, created by Redmon, showing
the process whereby TweakUI added the compressed folder option to the
new sub-menu in the right click context menu for open...
|
by: rdavis7408 |
last post by:
I have a database that has a form that opens a report using date
parameters. I have been using it for six months and last week I began
to get the following Error Message:
"File sharing lock...
|
by: Al Kaufman |
last post by:
I have a simple console app that uses:
regSubKey = <some registry key>
Dim reg As RegistryKey = Registry.ClassesRoot.OpenSubKey(regSubKey)
Dim path As String
path = CStr(reg.GetValue(""))
|
by: Bob |
last post by:
My question about how to add an assembly search path to VS.NET's IDE remains
unanswered, but I'm still faced with a problem possibly associated with
this: my exported registry is more than 67MB....
|
by: bazzer |
last post by:
hey,
im trying to access a microsoft access database from an ASP.NET web
application in visual basic 2003.NET. i get the following error when i
try running it:
Server Error in...
|
by: eSolTec, Inc. 501(c)(3) |
last post by:
Thank you in advance for any and all assistance.
Is there a way to create a registry key, but orphan it from the program that
created it?
Reason: Create a key, but not associate it with the...
|
by: Aussie Rules |
last post by:
Hi,
I want to store some data in the registry, however I have not been able to
do this, and think my logic maybe flawed.
Firstly I try to open the registry and read in any existing values....
|
by: JOSII |
last post by:
Getting a string of boolean value into and out of the registry is no problem.
Here's the problem:
Although you can place an object into the registry and retreive it, I need
to place an ArrayList...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |