Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: regconnect currentcontrolset
Before I can work with the function RegConnect, I must connect to these Workst. with rights of an admin-user. What function can I use to connect to a Workst. under admin-account.
Once you have connected as an administrator to the IPC$ share on the remote NT workstation you will be able to manage its registry. Be sure to disconnect from the IPC$ share after you have unloaded the registry hives from the remote NT workstation.
There is at least one caveat to be aware of. You cannot have any other connections to the remote NT workstation when you try to connect to the IPC$ share. The reason for this is that if any other connections (e.g. network drive letters, shared printer connections, etc...) do exist then you cannot override the credentials that are already in use for those connections. WinNT does not support the simultaneous of multiple sets of credentials between two systems on the network when dealing with the logged on user on the desktop of one system attempting to access resources on a remote system. This has to do with the way that credentials are inherited. If you were to use the wntRunAsUser() function to change your base set of credentials then this problem could be side-stepped.
The wntRunAsUser() function might actually serve better in this case if you know that the administrator username and password are identical on the two NT systems in question. Using wntRunAsUser() to make your script run under this common administrative account's credentials would then allow passthru authentication to happen and the registry manipulation functions should work just fine w/o any special connections being made to the IPC$ share on the remote NT workstation.
i.e. if you ping localhost from the dos prompt then it resolves the netbeui name of itself. Can you do this remotely?
Thoughts??
#1503 Regconnect: invalid computer name WinBatch 32 97D WIL ver 24dbHere's my code:
;regtest.wbt: filein = FileOpen("c:\progra~1\winbatch\system\wbt\servers.txt", "READ") line=FileRead(filein) while line != "*EOF*" rmtbox=RegConnect("\\%line%", @REGMACHINE) key=RegOpenkey(@REGMACHINE, "SOFTWARE\Axean") sbkys=RegQueryKeys(key) RegCloseKey(key) sbkys=StrReplace(sbkys,@tab,@crlf) Message("Registry Keys under SOFTWARE\Axean on \\%line%", SBKYS) line=FileRead(filein) endwhile FileClose(filein)
Connecting to servers 1-3 works OK, but connected to server 4 bombs with Error 1503. Any ideas?
Try...
filein = FileOpen("c:\progra~1\winbatch\system\wbt\servers.txt", "READ") line=FileRead(filein) while line != "*EOF*" rmtbox=RegConnect("\\%line%", @REGMACHINE) key=RegOpenkey(rmtbox, "SOFTWARE\Axean") sbkys=RegQueryKeys(key) RegCloseKey(key) RegCloseKey(rmtbox) sbkys=StrReplace(sbkys,@tab,@crlf) Message("Registry Keys under SOFTWARE\Axean on \\%line%", SBKYS) line=FileRead(filein) endwhile FileClose(filein)
bb=BinaryAlloc(16) BinaryEODSET(bb,16) hh=@REGMACHINE ; or @REGUSERS compname="\\FRED09" xx=DllCall("ADVAPI32.DLL",long:"RegConnectRegistryA",lpstr:compname,long:hh,lpbinary:bb) key=BinaryPeek4(bb,0) ;or if you do not have the latest version ;BinaryPeek4 required 96D or newer ; k0=Binarypeek(bb,0) ; k1=Binarypeek(bb,1) ; k2=Binarypeek(bb,2) ; k3=Binarypeek(bb,3) ; key=k0 + (k1<<8) + (k2<<16) + (k3<<24) BinaryFree(bb) ;Message("Key is",key) v=RegQueryValue(key,"software\microsoft\winnt\winlogon[autoadminlogon]") Message("AutoAdminLogon on %compname% is",v) RegCloseKey(key)
After the RegConnect, I'm doing a RegQueryKeys to itemize the subkeys under:
HKLM\System\CurrentControlset\control\print\printerswhich is where I can see all the individual printer names itemized, e.g. HP Laserjet 5, HP Laserjet 4/4M, etc.
Trouble is that RegQueryKeys returns the SHARENAMES of these printers, rather than the Printer names above.
This despite the fact that when he looks in the registry, the printer names are there.
Any idea why this is happening?
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurePipeServers\winreg\AllowedPathsand gives the allowed paths that a person can access.
Further information can be found at
For Windows XP
http://support.microsoft.com/?kbid=314837
For Windows NT, 2000
http://support.microsoft.com/?kbid=153183
The quasi-legal stuff outta the way, it works. Don't follow the piece about Remote Administration, the Remote Registry Service is what you want.
PSS ID Number: Q141460 Article last modified on 10-20-1997 95 WINDOWS ====================================================================== 95 WINDOWS kbnetwork kbhowto --------------------------------------------------------------------- The information in this article applies to: - Microsoft Windows 95 --------------------------------------------------------------------- SUMMARY ======= This article describes how to install the Remote Administration and Remote Registry services on a Windows 95-based computer. These services let you administer file and print sharing and edit the registry remotely (from another computer on the network). MORE INFORMATION ================ Both computers involved in Remote Administration must use the same level of security (either user-level or share-level security). Remote Administration contains three components: - Net Watcher - System Monitor - File System Administration To use System Monitor, user-level security is required and the Remote Registry service must be enabled on the computer being remotely administered. The Net Watcher and File System Administration tools do not require user-level security or that the Remote Registry service be enabled. Enabling the Remote Administration Service ------------------------------------------ 1. In Control Panel, double-click Network. 2. Click File And Print Sharing. Click both the "I want to be able to give others access to my files" and "I want to be able to allow others to print to my printer(s)" check boxes to select them, and then click OK. 3. In Control Panel, double-click Passwords. 4. On the Remote Administration tab, click the "Enable remote administration of this server" check box to select it. 5. Set a password for Remote Administration and then click OK. NOTE: If you are using user-level security, you do not receive a password dialog box. Instead, add users to the list by clicking Add. WARNING: If your computer is configured to use share-level security and the Remote Administration service is installed, a user is required to know only a password to remotely administer your computer. To help prevent unauthorized users from remotely administering computers, consider using user-level security, which allows access to only specified users. Installing the Remote Registry Service -------------------------------------- To use the Remote Registry service, you must be using user-level security and have the Remote Administration option enabled. To install the Remote Registry service, follow these steps: 1. If you are already using user-level security, skip to step 5. 2. In Control Panel, double-click Network. 3. On the Access Control tab, click User-Level Access Control. 4. Click OK. 5. In Control Panel, double-click Network. 6. Click Add, click Service, click Add, and then click Have Disk. 7. In the Copy Manufacturer's Files From box, type the path to the Admin\Nettools\RemoteReg folder on your Windows 95 CD-ROM, and then click OK. 8. When the Microsoft Remote Registry service has been added to the list of installed components, click OK. When you are prompted to restart your computer, do so. NOTE: In order to use user-level security, there must be a Microsoft Windows NT-based computer or Novell NetWare server on the network to act as a security provider. If you are using a Windows NT-based computer as your security provider, you must enable File and Printer Sharing for Microsoft Networks. If you are using a Novell NetWare server as your security provider, you must enable File and Printer Sharing for NetWare Networks. Microsoft has made updated drivers for File and Print Sharing available. For information about obtaining the updated drivers, please see the following article in the Microsoft Knowledge Base: ARTICLE-ID: Q128079 TITLE : Updated Drivers for File and Printer Sharing Security KBCategory: kbnetwork kbhowto KBSubcategory: win95 Additional reference words: 95 ====================================================================== Keywords : win95 kbhowto kbnetwork Version : 95 Platform : WINDOWS ============================================================================= Copyright Microsoft Corporation 1997.
Article ID: W13714
Filename: Connecting to a Registry on a Remote Computer.txt
File Created: 2003:07:23:12:22:36
Last Updated: 2003:07:23:12:22:36