Hallo,
danke für deine Antwort.
Habs nun aber doch noch mit VBS hinbekommen.
Dim oOU, oOutPutFile, oFileSYS
Set oFileSYS = WScript.CreateObject("Scripting.FileSystemObject")
Set oOutPutFile = oFileSYS.CreateTextFile("d:\Useroutput.csv",True)
' set LDAP path to the OU that you will list
Set oOU = GetObject("LDAP://OU=USERS,OU=OUName,DC=sub,DC=domain,DC=net")
' call the Sub ListUsers with the LDAP Path that you have set above.
oOutPutFile.WriteLine "Nachname,Vorname,ProfilePath,ScriptPath,HomeDrive,HomeDirectory,TerminalServicesProfilePath,TerminalServicesHomeDrive,TerminalServicesHomeDirectory"
ListUsers oOU
oOutPutFile.Close
Set oFileSYS = Nothing
Set oOU = Nothing
WScript.Quit(0)
' SUB to list the users with the parameter oCount. oCount contain the LDAP Path (GetObject("LDAP://OU=...)
Sub ListUsers(oCount)
Dim oUSR
For Each oUSR In oCount
Select Case LCase(oUSR.Class)
Case "user"
oOutPutFile.WriteLine oUSR.Get ("name") & (",") & oUSR.ProfilePath & (",") & oUSR.ScriptPath & (",") & oUSR.HomeDrive & (",") & oUSR.HomeDirectory & (",") & oUSR.TerminalServicesProfilePath & (",") & oUSR.TerminalServicesHomeDrive & (",") & oUSR.TerminalServicesHomeDirectory
End Select
Next
End Sub
Gruß