IIS 7 and Above
'Object reference not set to an instance of an object' error in IIS P...
Re: 'Object reference not set to an instance of an object' error in I...
Jun 12, 2009 10:36 AM|Mike C|LINK
I didn't cover myself in glory there did I? :)
Yes, if I perform the dir iis:\sites\default web site command (properly this time! :)) I get the same 'get-childitem' error as you describe.
So, this makes me wonder which security context the dir command runs under because my user account (which I am using to run PowerShell) has the correct permissions to read the shares. I can prove this by opening up the shares from the IIS machine in Explorer.
I also tested this giving the 'everyone' account 'full control' to both the share and file permissions and received the same problem.
Am I missing something (I expect so!). I will try some more troubleshooting in the meantime.