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
jerry williams4 pointsPosted Aug 31, 2008, 12:27 AM EDT
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
George GeorgeRank #2,261 · 618 pointsPosted Sep 1, 2008, 5:06 AM EDT
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