Hello everyone,
When executing the following script in PowerShell (or equivalent C# code, I post PS code for simplification purpose), there is always access denied error. My purpose is to retrieve default web site information from remote computer named TestMachine. When I changed TestMachine to my local machine name, it is fine. Does anyone have any ideas? I am already belonging to the administrator group of the remote machine.
$siteName = (Get-Wmiobject -computer "TestMachine" -namespace "root/MicrosoftIISv2" -q "SELECT * FROM IIsWebServerSetting WHERE ServerComment = "Default Web Site").Name
regards,
George
George GeorgePosted Sep 1, 2008, 9:06 AM
Thanks Jerry,
Good point to hint me the solution. Just want to clarify that, "adding aspnet(full) and network services (list)" -- you mean add user named "aspnet" and "network service" to be able to access the directory? What do you mean full and list here?
regards,
George
jerry williamsPosted Aug 31, 2008, 4:27 AM
hi George, i'm guessing here, but try changing the permissions on the IIS directory (wwwroot?) by clicking security and adding aspnet(full) and network services (list).
I find that most of our 'access denied' issues are caused by this.
cheers