Powershell - Setting the $AdminSessionADSettings.ViewEntireForest=$true parameter at startup
Posted on 2010-08-13
I added the above line to my powershell profile ($profile) so that I don't have to set the scope for AD everytime I use the shell. When I launch the shell, I get the following error:
Property 'ViewEntireForest' cannot be found on this object; make sure it exists
and is settable.
At C:\Documents and Settings\Allen.Jones\My Documents\WindowsPowerShell\Micros
+ $AdminSessionADSettings.V <<<< iewEntireForest=$true
However, I can then manually type in the command after the shell is loaded.
1. Is there a way to accomplish this?
2. Why is it that the shell will accept the command manually but not at startup?