I want to check the workgroup computers registry programmatically
work group computers are group of vista and xp systems.i can access the xp registry,but vista registry are not able to access.
how to access vista registry in xp system programmatically?
Please help me
Hirendra SisodiyaPosted Apr 16, 2010, 7:07 AM
You need to check remote registry service on that vista machine it is required, in xp machines startup type of this service is automatic(default) but not in vista...i have described in previous post
so check this setting and try again....if you have any problem let me know.
thanks
meenakshi sundariPosted Apr 16, 2010, 4:48 AM
Thanks, I can access all xp machines registry,But i want to get access vista machine.
I have the function for accessing vista by giving username,password of the vista system,
########################
'WearDrag("x", "y", "z")
'Dim environmentKey As RegistryKey
environmentKey = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, "Remotemachine")
Public Function WearDrag(ByRef Username As String, ByVal Password As String, ByVal DomainOrMachine As String) As WindowsImpersonationContext
Dim impersonationContext As WindowsImpersonationContext
Dim tempWindowsIdentity As WindowsIdentity
Dim token As IntPtr = IntPtr.Zero
Dim tokenDuplicate As IntPtr = IntPtr.Zero
If (RevertToSelf()) Then
If (LogonUserA(Username, DomainOrMachine, Password, LOGON32_LOGON_NEW_CREDENTIALS, LOGON32_PROVIDER_DEFAULT, token)) Then
If (DuplicateToken(token, 2, tokenDuplicate) <> 0) Then
tempWindowsIdentity = New WindowsIdentity(tokenDuplicate)
impersonationContext = tempWindowsIdentity.Impersonate()
If Not IsDBNull(impersonationContext) Then
CloseHandle(token)
CloseHandle(tokenDuplicate)
Return impersonationContext
End If
End If
End If
End If
If (token <> IntPtr.Zero) Then CloseHandle(token)
If (tokenDuplicate <> IntPtr.Zero) Then CloseHandle(tokenDuplicate)
Return Nothing
End Function
############################
But i want to get access by giving the ip address or machine name.
Please help me
Hirendra SisodiyaPosted Apr 14, 2010, 3:20 AM
What function , you are using for accesing registry system??? Ok..
According to you you can access all xp machine's registry except vista, it can happen,because Vista is rich security in compare of other xp operating systems..you need to check that Remote Registry services is running or not on that vista machine, it requires service to be running on the remote computer .
You cancheck this goto Run, type Services.msc, and see 'Remote Registry'. i think after that you can solve your problem.. one more thing you have enough permission also for access remote registry system
you can use this sample code
Dim tempKey As Microsoft.Win32.RegistryKey
tempKey = Microsoft.Win32.RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, "Put your machine name")
thanks
Please mark as answere if it helps