LogON LogOFF werden protokoliert

This commit is contained in:
ms
2022-12-28 09:58:58 +01:00
parent 18e00e475d
commit d694d26d19
18 changed files with 955 additions and 79 deletions

View File

@@ -16,9 +16,11 @@ Public Class cBenutzer
Property localdistinguishedName As String = ""
Property suchname As String = ""
Property Hostname As String = ""
Property Company As String = ""
Property Username As String = ""
'test
Function FillWithLoggedOnUser(Optional ByVal dcabfrage As Boolean = False, Optional ByVal LDAPa As String = "") '"LDAP://DC=VERAG,DC=OST,DC=DMN")
@@ -30,9 +32,10 @@ Public Class cBenutzer
End Try
Domäne = System.DirectoryServices.ActiveDirectory.Domain.GetCurrentDomain.ToString
BenutzeranmeldeName = Environment.UserDomainName & "\" & Environment.UserName
Username = Environment.UserName
If dcabfrage = True Then
'cRes.DebugText = userPrincipalName & LDAPa
'Class1.DebugText = userPrincipalName & LDAPa
FillFromDC(userPrincipalName, "userPrincipalName", LDAPa)
End If
End Function
@@ -96,6 +99,7 @@ Public Class cBenutzer
.PropertiesToLoad.Add("distinguishedName")
.PropertiesToLoad.Add("msDS-PrincipalName")
.PropertiesToLoad.Add("userPrincipalName")
.PropertiesToLoad.Add("company")
End With
Dim Result As DirectoryServices.SearchResult = searcher.FindOne
@@ -110,6 +114,7 @@ Public Class cBenutzer
Me.BenutzeranmeldeName = blablabla(Result, "msDS-PrincipalName")
Me.msDSPrincipalName = blablabla(Result, "msDS-PrincipalName")
Me.userPrincipalName = blablabla(Result, "userPrincipalName")
Me.Company = blablabla(Result, "company")
Catch ex As Exception
MsgBox("FillFromDC: " & ex.Message)