Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - connecting to remote registry not working sometimes

Reply
 
Old 2 Weeks Ago   #1 (permalink)
Tony Logan


 
 

connecting to remote registry not working sometimes

My script sometimes quits on this line:
Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &
strCompName & "\root\default:StdRegProv")

The script is for installing the Microsoft SCCM client to a group of remote
PCs. The script checks if the remote PC can be pinged, checks the local PC
for the necessary installation files, and copies whichever files are needed
to the remote PC. Remote PCs can either already have the SCCM client, the SMS
client (the previous version of SCCM), or neither client. If either the 2nd
or 3rd case are true, the SCCM client gets installed on the remote PC. The
script reports the results to a log file and runs against multiple PCs by
reading a txt file.

It works fine most of the time, but every so often it bombs at the line I
noted above. As an alternative I tried this:
Set objReg = GetObject("winmgmts:\\" & strCompName &
"\root\default:StdRegProv")

But that produced the same result: the script gets to that line and quits
running instead of continuing on to the rest of the script or going to the
next PC.

I added "On Error Resume Next" to the file to allow the script to continue
if it finds a PC it can't ping. But even when I comment that out, the code
errors on the lines above and then exits. The error message says "Permission
denied: GetObject. The remote server has been paused or is in the process of
being restarted."

All the PCs are Windows XP, Service Pack 2, Office 2003.

My System SpecsSystem Spec
Old 2 Weeks Ago   #2 (permalink)
Richard Mueller [MVP]


 
 

Re: connecting to remote registry not working sometimes


"Tony Logan" <TonyLogan@newsgroup> wrote in message
news:1DEEB21F-7A24-4299-B297-E8E5E34C0BEF@newsgroup
Quote:

> My script sometimes quits on this line:
> Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &
> strCompName & "\root\default:StdRegProv")
>
> The script is for installing the Microsoft SCCM client to a group of
> remote
> PCs. The script checks if the remote PC can be pinged, checks the local PC
> for the necessary installation files, and copies whichever files are
> needed
> to the remote PC. Remote PCs can either already have the SCCM client, the
> SMS
> client (the previous version of SCCM), or neither client. If either the
> 2nd
> or 3rd case are true, the SCCM client gets installed on the remote PC. The
> script reports the results to a log file and runs against multiple PCs by
> reading a txt file.
>
> It works fine most of the time, but every so often it bombs at the line I
> noted above. As an alternative I tried this:
> Set objReg = GetObject("winmgmts:\\" & strCompName &
> "\root\default:StdRegProv")
>
> But that produced the same result: the script gets to that line and quits
> running instead of continuing on to the rest of the script or going to the
> next PC.
>
> I added "On Error Resume Next" to the file to allow the script to continue
> if it finds a PC it can't ping. But even when I comment that out, the code
> errors on the lines above and then exits. The error message says
> "Permission
> denied: GetObject. The remote server has been paused or is in the process
> of
> being restarted."
>
> All the PCs are Windows XP, Service Pack 2, Office 2003.
On some clients it might help to use:

Set objReg = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate,authenticationLevel=Pkt}!\\" _
& strCompName & "\root\cimv2")

If that doesn't work, then possibly a firewall is blocking. The following
command at a command prompt on the problem PC should unblock:

netsh firewall set service remoteadmin enable

Finally, WMI can become corrupt. I have used the following links to help
troubleshoot:

http://www.microsoft.com/technet/scr.../help/wmi.mspx

http://support.microsoft.com/kb/875605

http://www.microsoft.com/technet/scr...es/wmifaq.mspx

You can rebuild the WMI repository, if you have XP SP2, with the command:

rundll32 wbemupgd, UpgradeRepository

The following commands reinstall WMI in the registry:

winmgmt /clearadap
winmgmt /kill
winmgmt /unregserver
winmgmt /regserver
winmgmt /resyncperf

http://msdn.microsoft.com/en-us/libr...86(VS.85).aspx

I hope this helps.

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Remote Assistance Not Connecting Vista networking & sharing
Re: Remote registry PowerShell
Remote registry PowerShell
getting remote registry PowerShell
Remote Registry PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46