Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Function Displays Incorrect Data on Server 2012

$
0
0

I've got a very odd situation. We have a simple PS function the uses .NET DirectoryServices to do a Simple Bind to a Novell eDirectory server, and return a few values of a object (function below, Exhibit A). This has been working fine for some time, running on a 2008 R2 server with PSv2. We recently moved it to a new 2012 server with PSv3 and the same function returns different results (Exhibit B).

I've tried starting PowerShell on Server 2012 with the -version 2 option. No change. I've verified via network trace the the correct values are being returned by the eDirectory server.

Any Ideas?

Geoff

Exhibit A

function Get-eDirPasswordPolicySettings {
$ldap_server = "LDAP://xxxxxxxx.xxxxxx.com/cn=Password Policies,cn=Security"
$ldap_auth = [System.DirectoryServices.AuthenticationTypes]::None
$ldap_user = "cn=passwordpolicyalert,ou=WorkAccounts,ou=SERVICES,o=JEDI"
$ldap_passwd = "xxxxxxxxx"
$ldap_c = New-Object System.DirectoryServices.DirectoryEntry($ldap_server, $ldap_user, $ldap_passwd, $ldap_auth)
$filter = "(&(objectClass=nspmPasswordPolicy)(nsimAssignments=OU=users,ou=vault,o=jedi))"
$attrs = "cn","nsimAssignments","nspmCaseSensitive","nspmMaximumLength","passwordMinimumLength","description"
$searcher = New-Object DirectoryServices.DirectorySearcher($ldap_c, $filter)
$searcher.SearchScope = "Subtree"
$attrs | foreach {[void]$searcher.PropertiesToLoad.Add($_)}
$result = $searcher.findAll()
$result[0].properties

}

Exhibit B


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>