M
Marco Herrn
Hi,
I have an application in C# that manages users, shares and printers in
the AD. This application sometimes runs on an error accessing the AD.
This is not really reproducable, it happens often, but not always.
Sometimes it runs on an error and later goes over the same code again
and works. The error message is always a NullReferenceException on
System.DirectoryServices.Interop.IAds.GetEx, for example:
at System.DirectoryServices.Interop.IAds.GetEx(String bstrName)
at System.DirectoryServices.PropertyValueCollection.PopulateList()
at System.DirectoryServices.PropertyCollection.get_Item(String
propertyName)
at amt.user.UserManagement.getUserByDirectoryEntry(DirectoryEntry
ADEntry) in c:\inetpub\wwwroot\amt\sharp\user\UserManagement.cs:line 2098
at amt.user.UserManagement.getUserByProperty(String Property, String
domain) in c:\inetpub\wwwroot\amt\sharp\user\UserManagement.cs:line 1900
at amt.user.UserManagement.getUserBySAM(String SAM, String domain)
in c:\inetpub\wwwroot\amt\sharp\user\UserManagement.cs:line 576
at replication.RootDSEReplicator.checkUserReplicationStatus(AddEntry
entry) in
c:\inetpub\wwwroot\amt\sharp\replication\RootDSEReplicator.cs:line 284
at replication.RootDSEReplicator.checkReplicationStatus(Object
state) in
c:\inetpub\wwwroot\amt\sharp\replication\RootDSEReplicator.cs:line 244
I haven't seen any pattern when this happens. The NulRef obviously
doesn't happen in my code. It seems to happen in one case on this action:
if(ADEntry.Properties["distinguishedName"].Value != null){
newUser.DN= ADEntry.Properties["distinguishedName"].Value.ToString();
}
Any ideas what can cause this? What surprises me is, that the NullRef
isn't thrown by my code, but from inside IAds.
Regards
Marco
I have an application in C# that manages users, shares and printers in
the AD. This application sometimes runs on an error accessing the AD.
This is not really reproducable, it happens often, but not always.
Sometimes it runs on an error and later goes over the same code again
and works. The error message is always a NullReferenceException on
System.DirectoryServices.Interop.IAds.GetEx, for example:
at System.DirectoryServices.Interop.IAds.GetEx(String bstrName)
at System.DirectoryServices.PropertyValueCollection.PopulateList()
at System.DirectoryServices.PropertyCollection.get_Item(String
propertyName)
at amt.user.UserManagement.getUserByDirectoryEntry(DirectoryEntry
ADEntry) in c:\inetpub\wwwroot\amt\sharp\user\UserManagement.cs:line 2098
at amt.user.UserManagement.getUserByProperty(String Property, String
domain) in c:\inetpub\wwwroot\amt\sharp\user\UserManagement.cs:line 1900
at amt.user.UserManagement.getUserBySAM(String SAM, String domain)
in c:\inetpub\wwwroot\amt\sharp\user\UserManagement.cs:line 576
at replication.RootDSEReplicator.checkUserReplicationStatus(AddEntry
entry) in
c:\inetpub\wwwroot\amt\sharp\replication\RootDSEReplicator.cs:line 284
at replication.RootDSEReplicator.checkReplicationStatus(Object
state) in
c:\inetpub\wwwroot\amt\sharp\replication\RootDSEReplicator.cs:line 244
I haven't seen any pattern when this happens. The NulRef obviously
doesn't happen in my code. It seems to happen in one case on this action:
if(ADEntry.Properties["distinguishedName"].Value != null){
newUser.DN= ADEntry.Properties["distinguishedName"].Value.ToString();
}
Any ideas what can cause this? What surprises me is, that the NullRef
isn't thrown by my code, but from inside IAds.
Regards
Marco