RE: Permission Denied 800A0046 GetObject

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Actually I got the script working via a text file containing the names of the
computers...my guess is that I don't have some kind of permission to Active
Directory to retrieve the information I was looking for...although I am a
Domain Admin as well as Enterprise Admin, but I guess this impersonation
thing might have something to do with it...still am curious as to how to get
this working in the future using Active Directory and Ldap names.

Here is the script that ended up working for me and I ran it from a command
prompt, i.e. cscript proxysettings_mult.vbs > proxyreport.txt

On Error Resume Next
INPUT_FILE_NAME = "C:\Scripts\Computers.txt"
Const FOR_READING = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(INPUT_FILE_NAME, FOR_READING)
strComputers = objFile.ReadAll
objFile.Close
arrComputers = Split(strComputers, vbCrLf)
For Each strComputer In arrComputers

Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & _
"\root\cimv2\Applications\MicrosoftIE")

Set colIESettings = objWMIService.ExecQuery _
("Select * from MicrosoftIE_LANSettings")

For Each strIESetting in colIESettings
wscript.Echo "Computer Name: " & strComputer
Wscript.Echo "Autoconfiguration proxy: " & strIESetting.AutoConfigProxy
Wscript.Echo "Autoconfiguration URL: " & strIESetting.AutoConfigURL
Wscript.Echo "Autoconfiguration Proxy detection mode: " & _
strIESetting.AutoProxyDetectMode
Wscript.Echo "Proxy: " & strIESetting.Proxy
Wscript.Echo "Proxy override: " & strIESetting.ProxyOverride
Wscript.Echo "Proxy server: " & strIESetting.ProxyServer & vbCrLf
Next
Next


"Lucy Phelan" wrote:

> I am trying to run the following script:
> 'On Error Resume Next
> set colComputers = GetObject("LDAP://OU=Desktops, DC=warren,
> DC=interlink-intranet, DC=net")
> For Each objComputer in colComputers
> strComputer = objComputer.CN
> Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
> Set colItems = objWMIService.ExecQuery("Select * from Win32_Proxy",,48)
> For Each objItem in colItems
> Wscript.Echo "Caption: " & objItem.Caption
> Wscript.Echo "Description: " & objItem.Description
> Wscript.Echo "ProxyPortNumber: " & objItem.ProxyPortNumber
> Wscript.Echo "ProxyServer: " & objItem.ProxyServer
> Wscript.Echo "ServerName: " & objItem.ServerName
> Wscript.Echo "SettingID: " & objItem.SettingID
> Next
> Next
>
> and I get an error 800A0046 Permission Denied error on GetObject...now I get
> the fact that it is a permission problem but how can I resolve it so that I
> can get the proxy info from the computers in my domain that I desire?
>
> Thanks in advance.
.



Relevant Pages

  • Re: editing licensed shows
    ... You can do almost anything with CHESS if you get permission. ... the first productions done after Broadway was by the Long Beach Civic ... The script was very much changed by director ...
    (rec.arts.theatre.musicals)
  • RE: Help needed setting user security rights through a script
    ... 'this script will set permission on given folder... ... 'Folder on which permissions will be applied, ... 'users:C means "Users" group will be assigned Change permission. ... > install or uninstall applications. ...
    (microsoft.public.windows.server.scripting)
  • Re: User Account Security
    ... Better post this under the original posting, so that anybody could follow it and find it again. ... after some times about 30 minutes all permission changed with other ... I created a script and disabled this settings ... the password you add two deny ACE's to the DACL. ...
    (microsoft.public.windows.server.active_directory)
  • Re: Command line cannot fwrite, browser can
    ... Using the command line, the script gives a warning, and then fails saying ... Classic windows permission issue. ...
    (comp.lang.php)
  • Re: Writing or copying file to another directory
    ... The Open Source movement says the same thing. ... Just to let you know I have fixed the perl script so that it no longer shows errors using strict and warnings. ... I am concerned about security especially now that I have FTP access to the Sierra Club server. ... Does an executable script, accessed by anyone through a link in the web page, have write permission to files with permission set at, for example, 700? ...
    (comp.lang.perl.misc)