Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

VB / VBS Active Directory [ADSI]

Empfohlene Antworten

Hallo alle zusammen.

Habe ein Problem :(

Bin gerade in einem Praktikum und muss ein Script in VB bzw. VBS Programmieren.

Dieses soll aus der Active Directory (Windows Server 2003) verschiedene Attribute auslesn.

User -> Name, Vorname, Email

Computer -> Name

Danach soll dies mit einer Access Datenbank abgeglichen werden.

Aber mir gehts erstmal ums auslesen. Bin ned alllzufitt in VB und hab mal das Internet nen bissel durchforstet.... kein erfolg....

Hab zwar scripte gefunden die ienen user oder alle user eienr OU auslesen aber dies konnte ich nicht verwenden.

Die ADS ist folgendermaßen aufgebaut.

- OU Company

-- OU Filiale

--- OU Standort

---- OU Abteilung

----- OU Mitarbeiter

Hierzu zu sagen ist, das jeder Mitarbeiter seine eigene OU hat... z.b:

gast1 ist mit seinem computer g001 in der OU g01.

gast2 ist mit seinem computer g002 in der OU g02.

usw...

Hoffe jemand kann mir helfen...

Brauch also ein Script, das alle OUs nach vorgegebenen Objekten und deren attribute durchsucht und dann ausgibt.

Danke schonmal für eure Hilfe.

Mit freundlichen Grüssen

FisyX ;)

Hab ne Antwort gefunden

 

'Global variables

Dim oContainer

Dim OutPutFile

Dim FileSystem


'Initialize global variables

Set FileSystem = WScript.CreateObject("Scripting.FileSystemObject")

Set OutPutFile = FileSystem.CreateTextFile("struktur.txt", True)

Set oContainer=GetObject("LDAP://")


'Enumerate Container

EnumerateUsers oContainer


'Clean up

OutPutFile.Close

Set FileSystem = Nothing

Set oContainer = Nothing


WScript.Echo "Finished"

WScript.Quit(0)

Sub EnumerateUsers(oCont)

Dim oUser

For Each oUser In oCont

Select Case LCase(oUser.Class)

Case "user"



If Not IsEmpty(oUser.distinguishedName) Then

OutPutFile.WriteLine "dn: " & oUser.distinguishedName

End If 



If Not IsEmpty(oUser.name) Then 

OutPutFile.WriteLine "name: " & oUser.Get ("name")

End If

'need to do this because oUser.name would get back the Relative Distinguished name (i.e. CN=Jo Brown)


If Not IsEmpty(oUser.st) Then 

OutPutFile.WriteLine "st: " & oUser.st

End If


If Not IsEmpty(oUser.streetAddress) Then 

OutPutFile.WriteLine "streetAddress: " & oUser.streetAddress

End If







If Not IsEmpty(oUser.givenName) Then

OutPutFile.WriteLine "Vorname: " & oUser.givenName

End If


If Not IsEmpty(oUser.sn) Then

OutPutFile.WriteLine "Nachname: " & oUser.sn

End If


If Not IsEmpty(oUser.mail) Then

OutPutFile.WriteLine "E-Mail: " & oUser.mail

End If


If Not IsEmpty(oUser.computerName) Then

OutPutFile.WriteLine "E-Mail: " & oUser.computerName

End If



Case "organizationalunit" , "container"


EnumerateUsers oUser

End Select

OutPutFile.WriteLine 

Next

End Sub


Ach ja .... um die einzelnen ADS-LDAP Namen rauszufinden könnt ihr die Seite

http://www.kaczenski.de/it-service/ad-ldap.htm verwenden oder das Programm Namens hyena ^^

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Konto

Navigation

Suchen

Suchen

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.