Hi,
I am writing a simple powershell commands in powershell 2.0 running on Windows 2003 server. I verified the userid and password are correct. But I am getting "Getting format-default : The following exception occurred while retrieving member "PSComputerName":"An operations error occurred" error.
Here is 2 lines of script:
PS C:\Documents and Settings> $ou = New-Object System.DirectoryServices.DirectoryEntry "LDAP://DC=dfdev,DC=tdc,DC=com, OU=infrastructureservers", $user, $pwd
PS C:\Documents and Settings> $ou
Error message:
format-default : The following exception occurred while retrieving member "PSCo
mputerName": "An operations error occurred.
"
+ CategoryInfo : NotSpecified: (:) [format-default], ExtendedType
SystemException
+ FullyQualifiedErrorId : CatchFromBaseGetMember,Microsoft.PowerShell.Comm
ands.FormatDefaultCommand
Could someone please advise what could be the issue with my code?
Thanks