![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Permissions to execute the script Hi All, I am using a vbscript to query the WMI classes. The script uses the following line ... Set objWMIService = GetObject("winmgmts:\\" & sComp & "\root\cimv2") On some machines, this vbscript works fine but on some machines this script failes giving the following error: Permission Denied: GetObject Code: 800A0046 Source: Microsoft VBScript runtime error Looks like some issue due to some machine specific setting as the script runs fine on some machines. Any pointers to resolve this is highly appreciated! Rgds AN |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Permissions to execute the script "AN" <an@xxxxxx> wrote in message news:uq$0Z5TLKHA.5992@xxxxxx Quote: > Hi All, > > I am using a vbscript to query the WMI classes. The script uses the > following line ... > > Set objWMIService = GetObject("winmgmts:\\" & sComp & "\root\cimv2") > > On some machines, this vbscript works fine but on some machines this > script failes giving the following error: > > Permission Denied: GetObject > Code: 800A0046 > Source: Microsoft VBScript runtime error > > Looks like some issue due to some machine specific setting as the script > runs fine on some machines. > > Any pointers to resolve this is highly appreciated! > > > Rgds > AN > > remote computers with WMI: 1. You cannot connect to computer running XP Home. 2. An NT computer cannot connect to OS later than W2k. 3. A W2k3 computer cannot connect to Win9x. 4. To connect to W2k Server SP4 you must set impersonation level to Impersonate. 5. W2k computers must have SP2 to connect to XP or above. 6. W2k3 can only connect to Win9x and NT if credentials supplied. 7. To connect to XP or W2k3 you must set authentication level to Pkt. I'm not sure when (or if) setting impersonationLevel and authenticationLevel is required, but it can't hurt. For best results in all situations, I use code similar to: strComputer = "pc_name" Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate,authenticationLevel=Pkt}!\\" _ & strComputer & "\root\cimv2") WMI can also be blocked or corrupted. I have used the following links for troubleshooting: http://www.microsoft.com/technet/scr.../help/wmi.mspx http://support.microsoft.com/kb/875605 http://www.microsoft.com/technet/scr...es/wmifaq.mspx I found the following to enable WMI in the firewall: netsh firewall set service remoteadmin enable 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 -- Richard Mueller MVP Directory Services Hilltop Lab - http://www.rlmueller.net -- |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Permissions to execute the script "Richard Mueller [MVP]" <rlmueller-nospam@xxxxxx> wrote in message news:OOmH$sWLKHA.6016@xxxxxx Quote: > > "AN" <an@xxxxxx> wrote in message > news:uq$0Z5TLKHA.5992@xxxxxx Quote: >> Hi All, >> >> I am using a vbscript to query the WMI classes. The script uses the >> following line ... >> >> Set objWMIService = GetObject("winmgmts:\\" & sComp & "\root\cimv2") >> >> On some machines, this vbscript works fine but on some machines this >> script failes giving the following error: >> >> Permission Denied: GetObject >> Code: 800A0046 >> Source: Microsoft VBScript runtime error >> >> Looks like some issue due to some machine specific setting as the script >> runs fine on some machines. >> >> Any pointers to resolve this is highly appreciated! >> >> >> Rgds >> AN >> >> general you need to be a member of the local administrators group on the remote computer in order to retrieve information with WMI remotely. The group "Domain Admins" is added to the local administrators group by default when the computer is joined to the domain, so if you are member of that group you should be fine. Otherwise, the restricted groups feature can be used to add other domain groups to the local administrators group of all computers. -- Richard Mueller MVP Directory Services Hilltop Lab - http://www.rlmueller.net -- |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Permissions to execute the script Thanks so much for taking the time to help! I shall try with the authentication level to pkt; hope it works! Rgds AN "Richard Mueller [MVP]" <rlmueller-nospam@xxxxxx> wrote in message news:OxR0jQcLKHA.4376@xxxxxx Quote: > > "Richard Mueller [MVP]" <rlmueller-nospam@xxxxxx> wrote in > message news:OOmH$sWLKHA.6016@xxxxxx Quote: >> >> "AN" <an@xxxxxx> wrote in message >> news:uq$0Z5TLKHA.5992@xxxxxx Quote: >>> Hi All, >>> >>> I am using a vbscript to query the WMI classes. The script uses the >>> following line ... >>> >>> Set objWMIService = GetObject("winmgmts:\\" & sComp & "\root\cimv2") >>> >>> On some machines, this vbscript works fine but on some machines this >>> script failes giving the following error: >>> >>> Permission Denied: GetObject >>> Code: 800A0046 >>> Source: Microsoft VBScript runtime error >>> >>> Looks like some issue due to some machine specific setting as the script >>> runs fine on some machines. >>> >>> Any pointers to resolve this is highly appreciated! >>> >>> >>> Rgds >>> AN >>> >>> > I probably should mention if you think permissions are the problem, that > in general you need to be a member of the local administrators group on > the remote computer in order to retrieve information with WMI remotely. > The group "Domain Admins" is added to the local administrators group by > default when the computer is joined to the domain, so if you are member of > that group you should be fine. Otherwise, the restricted groups feature > can be used to add other domain groups to the local administrators group > of all computers. > > -- > Richard Mueller > MVP Directory Services > Hilltop Lab - http://www.rlmueller.net > -- > > |
My System Specs![]() |
| | #5 (permalink) |
| | Re: Permissions to execute the script I tried your steps but still it does not work. Can you please let me know if there is something else that i can try out? TIA AN "Richard Mueller [MVP]" <rlmueller-nospam@xxxxxx> wrote in message news:OxR0jQcLKHA.4376@xxxxxx Quote: > > "Richard Mueller [MVP]" <rlmueller-nospam@xxxxxx> wrote in > message news:OOmH$sWLKHA.6016@xxxxxx Quote: >> >> "AN" <an@xxxxxx> wrote in message >> news:uq$0Z5TLKHA.5992@xxxxxx Quote: >>> Hi All, >>> >>> I am using a vbscript to query the WMI classes. The script uses the >>> following line ... >>> >>> Set objWMIService = GetObject("winmgmts:\\" & sComp & "\root\cimv2") >>> >>> On some machines, this vbscript works fine but on some machines this >>> script failes giving the following error: >>> >>> Permission Denied: GetObject >>> Code: 800A0046 >>> Source: Microsoft VBScript runtime error >>> >>> Looks like some issue due to some machine specific setting as the script >>> runs fine on some machines. >>> >>> Any pointers to resolve this is highly appreciated! >>> >>> >>> Rgds >>> AN >>> >>> > I probably should mention if you think permissions are the problem, that > in general you need to be a member of the local administrators group on > the remote computer in order to retrieve information with WMI remotely. > The group "Domain Admins" is added to the local administrators group by > default when the computer is joined to the domain, so if you are member of > that group you should be fine. Otherwise, the restricted groups feature > can be used to add other domain groups to the local administrators group > of all computers. > > -- > Richard Mueller > MVP Directory Services > Hilltop Lab - http://www.rlmueller.net > -- > > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| powershell script to execute simultaneously instead of sequentially | PowerShell | |||
| execute Exchange script from DOS - how to get result? | PowerShell | |||
| Execute a powershell script from a webpage | PowerShell | |||
| execute powershell script from commmand line | PowerShell | |||
| AD LogOn Scripts Execute permissions | Vista account administration | |||